I am looking for a good pseudo-random number generation algorithm for passwords.

My scenario is that I have to generate 5K pseudo-random bits from a user-supplied password (6 characters). What are possible options and which one would be able to cover for my purposes?

  • $\begingroup$ with 6 characters you're doomed. Even with optimistic assumptions that's merely 36 bits of entropy. $\endgroup$ Nov 7, 2012 at 14:03

1 Answer 1


Scrypt is the best function for key-stretching we have. With such a bad password, you'll need all the stretching you can get, so make sure to use a large work parameter and a fast implementation.

But you should really consider using a stronger password. 10 random characters are much better than only 6.

  • $\begingroup$ thanks. but i am talking about algorithmic perspective not from the coding perspective. What are other possible options and why do you recommend some specific option? $\endgroup$
    – Mushahid
    Nov 7, 2012 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.