Stack overflow is a forum for helping you with coding issues.
This question is more suited to The security forum.
That said, there are some standardized guidelines for encryption.
When implementing a symmetric encryption cipher, it's best to use the AES Algorithm. This is the most secure symmetric key block cipher to date, and is the standard for what we currently consider as "protected".
If you're looking to hash passwords, which is the standard for password storage, then there is no need for a key. Use the SHA1 algorithm. In terms of the size of the output, it is the more secure hashing algorithm that is currently in use. Other options are SHA256 and SHA512
Edit: Oh the times they are a changing. And so are the hashing algorithms! People are moving from the SHA family of hashing algorithms to Bcrypt, which has several other features like introducing a cost factor to protect against rainbow tables.