As the title of the post says, I am testing a bit of code where I enter data on my form, then encrypt all the fields using MD5 (or whatever you think is best) and send it to my MS SQL Database.
$query = "INSERT INTO table_hide(firstname,last)
VALUES('".md5('Gary')."','".md5('Long')."');
Of course the database data is encrypted and I would like to read it.
I am also aware of using EncryptByPassPhrase and DecryptByPassPhrase in MS SQL to Encrypt and Decrypt a password. However, I would like assistance in using the same "key"
in the website to encrypt and on the SQL server to decrypt
So my question is, how would I encrypt my data I'm sending to my database and then have that same key in my database to decrypt it.