I did some research and all the method to generate passwords seems to include a 'random' part. What if I want to generate a password, secure as possible, with no random parts, so to be able to have a script generating it (again and again with the same result)?
Let's say in my website I have a user having username 'foo_bar'. Doing something like
hash('sha512', 'foo_bar'.'some_secret_word')
to generate his password could be the best way to proceed?
EDIT: I need my script to generate the same password giving it in input the same string, so everything involving rand() is not an answer
EDIT: Let's detail the problem. I have a long list of user data (username,email,address,etc) in a csv form. I have to import them inside my website (built on a CMS). I know how to import them, generating users, but I need to generate, by my own php, their password, in order to see them at any time, for I need to print the credentials to the users at different times. Generating passwords with any random element means not to be able to have and print the credential at any time. For some reasons, I can't simply generate them one time, store them somewhere and check later. Obviously, I can't generate password with a simple method like password='username_astring' for any user looking at his own password would know everyone else's password, so I was thinking a good way was using this method, but encrypting the string. However this idea seems not quite 'clean' to me and I was guessing if there is a more standard and clean solution.