If anyone's interested, here are different implementations of this general procedure in languages like PHP, Ruby, JavaScript, and so on. The PHP implementation is indeed just 3 lines:
password_hash($password, PASSWORD_BCRYPT); $salt = '$2y$10$' . mcrypt_create_iv(22); $salted_password = crypt($password, $salt);
Yes, I remember because I had to port a similar algorithm in Java and it was like 200 lines of code vs this one!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If anyone's interested, here are different implementations of this general procedure in languages like PHP, Ruby, JavaScript, and so on. The PHP implementation is indeed just 3 lines:
Yes, I remember because I had to port a similar algorithm in Java and it was like 200 lines of code vs this one!