See here: https://code.google.com/p/crypto-js
Which one of these encryption methods is best for storing encrypted values in a database? I need some method of encryption that lets the process convert the string back and forth in the same manner every time.
For example: "sadfjpihdsf3njdasf" would convert to "hello world" and "hello world" always converts to "sadfjpihdsf3njdasf". The encryption methods I have tried yet seem to give me a different encrypted string each time.
The purpose of this is mainly to reduce the visibility of passwords stored in a secure database, so the level of security involved is rather basic.
All the symmetric ciphers in CryptoJS can be used in the way you described. The reason you see a different value every time is because a new random IV is generated every time. You can generate the IV yourself for every unique value you have as seen here.
Generally, passwords are not encrypted, but iteratively hashed with a salt. So, when the user authenticates the next time, the application can hash the typed in password and check if the values match. The salt and the number of iterations would be stored in additional columns or along side the hash.
CryptoJS provides a good hashing method for this case if you want to do this on the client side or anywhere where JavaScript is runnable, because CryptoJS basically has no dependencies: PBKDF2