drupalcryptographypasswordsmd5cryptographic-hash-function

How to create encrypted hash passwords for drupal 7


After searching over internet I came to know that With drupal 7, password are no more encrypted through md5.

What are possible ways to get passwords encrypted in Drupal 7??


Solution

  • With drupal 7, password are no more encrypted through md5. There are several way to get/set a password in drupal7. Using drush (for your information, not used in your case):

    drush upwd admin --password="newpassword"
    

    Without drush, if you have a cli access to the server : (for your information, not used in your case)

    cd <drupal root directory>
    
    php scripts/password-hash.sh 'myPassword'
    

    Now copy the resultant hash and paste it into the query:

    update users set name='admin', pass='pasted_big_hash_from_above' where uid=1;