Let me start by saying that I am new to the encryption arena. With that said, I am developing an application and need to store username, password and full name (first, middle, last) encrypted in a database table. I was reading an article that the IV should be random for each encryption that occurs and that I could prepend the IV to the ciphertext.
This is where it gets confusing. How would I decrypt the string if I prepend text to it unless I know exactly where in the string the IV ends and the ciphertext begins? Also, I was reading that I should salt the string by appending or prepending additional text before I actually encrypt. I.E., some string I create and prepend or append that to the plaintext, am I correct in my understanding of salting?
If I am storing the encrypted username and password in the database, should I worry about any issues when I need to authenticate a user. Can I reliably encrypt the username and password after the user enters the fields, then compare the encrypted values against the encrypted columns in the database? It seems as if this would be a problem and if so, what is the recommended way of handling this?