There are number of scenarios where you need to store your password in encrypted form.
While doing that you encrypt it using many techniques like MD5 Hashing etc whatever according to your requirement
When we use SQL encrypt and decrypt password mechanism we will store it with password salt
It will look like after encryption
Password
0x01000000BCA09EEC4229FCF948FAD26EF3D7E25AD33AB30FD05733AE
Password Salt
f2e20931-e0b1-4d69-8222-03e4874cdba5
Password Salt is used for encrypting and decrypting your password . It acts like a key that will be used to encrypt the password and decrypt the password.
select CONVERT(VARCHAR(50), DECRYPTBYPASSPHRASE (PasswordSalt, Password)), * from [dbo].[User] where email = 'test1@test1.com'
You can decrypt your password by writing this query where you will pass your encrypted password and its salt as parameters into it
It will show you the decrypted password that you entered at its original form
0 Comment(s)