In fact, you are not encrypting the user password, you are using it.
SHA2, SHA-256 SHA-512. . Ruby, - .
salt <- generateRandomSalt();
method hashPassword(password)
hash <- password
reps <- 5000 // Tune this number to your system
for (reps times)
hash <- hash + salt // Concatenate
hash <- SHA256(hash)
end for
return hash
end hashPassword
. , , , . .
, , , , . 64 128 ( 8 16 ) . (5000 ) - . , 0,1 . , .