Forums

[resolved] decrypt password in list (5 posts)

  1. F J Kaiser
    Member
    Posted 2 years ago #

    Hi,

    I´m trying to make a list of users on a private page. In this list i got the user name and the user password/user_pass. My problem is now, that i can only display the encrypted password. Does anyone know how to get the decrypted version displayed?

    Thanks a lot!

    Ps. Here´s my current code.

    global $wp_roles;
    foreach( $wp_roles->role_names as $role => $name ) {
      echo '<thead> <tr> <th>Nicename</th> <th>Displayname</th> <th>Passwort</th> </tr> </thead>';
      echo '<tbody>';
    $this_role = "'[[:<:]]".$role."[[:>:]]'";
      $query = "SELECT * FROM $wpdb->users WHERE ID = ANY (SELECT user_id FROM $wpdb->usermeta WHERE meta_value RLIKE $this_role) ORDER BY user_nicename ASC LIMIT 10000";
      $users_of_this_role = $wpdb->get_results($query);
      if ($users_of_this_role) {
        foreach($users_of_this_role as $user) {
          $curuser = get_userdata($user->ID);
            echo '<tr><td>' . $curuser->user_nicename . '</td><td>' . $curuser->display_name . '</td><td>' . $curuser->user_pass . '</td></tr>';
    echo '</tbody>';
  2. Mark / t31os
    Moderator
    Posted 2 years ago #

    Part of the reasoning behind encrypting the password in the first place is so it can't be deciphered by anyone who gets the encrypted string...

    The answer is, you can't, else any WordPress admin would be able to read his/her users passwords.. which could be passwords they use often (can you imagine the implications of that)...

  3. F J Kaiser
    Member
    Posted 2 years ago #

    @t31os_: Thanks for your answer. I got your point. But how can it be that the password, that the user receives after a reset per mail, is plain text? There has to be some function that converts it... or not?

  4. Mark / t31os
    Moderator
    Posted 2 years ago #

    It sends you the password before all the encryption stuff happens.

    Resetting auto generates a password, again it just sends you the pre-encrypted version... once the email is sent, it's sent to the database and encrypted using MD5 (assuming no errors occured)..

  5. F J Kaiser
    Member
    Posted 2 years ago #

    @t31os_: Thanks for your answer! This makes sense (in other case than mine > i have to the register the users & set the password myself). Thanks anyway!

Topic Closed

This topic has been closed to new replies.

About this Topic