Is there a scrypt password hashing class? #scrypt
Edit
by William Wallace - 9 years ago (2015-06-21)
Password hashing algo wanted
| I need a good password hashing algo.
1st solution: for(i=0; $i<pow(2,20); $i++) { $password = hash('sha256', $password . $salt); }
2nd solution: echo password_hash('password', PASSWORD_DEFAULT);
Is there a 3rd solution? What is that?
Is scrypt the new panacea? What is scrypt? |
Ask clarification
2 Recommendations
Scyth: Encrypt data with PBKDF2 and Ceasar in pure PHP
This package can encrypt data with PBKDF2 and Ceasar in pure PHP
It takes a data string and encryption password to encrypt the data.
One class uses a pure PHP implementation of PBKDF2 to create a new key from the password. The resulting key is used to actually encrypt the data. The encrypted data may optionally be encoded using base64.
The class can also decrypt previously encrypted data also using the PBKDF2 of the encryption.
The encryption algorithm and block mode are configurable parameters.
Another class implements implements the Caesar's cipher. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet.
For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence.
| by Manuel Lemos 26695 - 9 years ago (2015-06-22) Comment
The latest PHP releases provide PBKDF2 implementations, but if you need a general solution that works in any PHP version, this class provides a pure PHP implementation of either PBKDF2 and Ceasar. These algorithms also implement key derivation functions. |
This class can create and verify password hashes with SHA and MD5 algorithms.
It can take a given password and create an hash with a salt value using either the crypt, MD5, SHA256 or SHA512 hashing algorithms many rounds.
The class can also take a previous generated hash and verify if it corresponds to a given password.
It can also generate a new hash for a given password and a previously generated hash.
| by Dave Smith 7620 - 9 years ago (2015-06-22) Comment
I would check out this class, seems to cover most of the basics.
I have not dealt with scrypt before, apparently it is KDF (key derivation function) to derive secret keys from secret values. |
- 1 Comment
1.
by Dave Smith - 9 years ago (2015-06-22) Reply
I must point out that my recommendation was made when the question was about wanting a password hashing class. The question now appears to have been changed to wanting a specific class for scrypt.