
This one way encrypting process can be exactly what you need though. In order to use this encrypted value in the table, have your program encrypt the password that the user types in using the same function that originally encrypted the file so it would look like this (logically)
Encrypt(”password”) -> 2gub3dk9292jfjsdl //this would be stored in the table
And when a user provides credentials, encrypt the password and compare the values.
Encrypt(”notthepass”) ->58jalgjad9g8ere34j
if (2gub3dk9292jfjsdl == 58jalgjad9g8ere34j) // FALSE
if (2gub3dk9292jfjsdl == 2gub3dk9292jfjsdl ) //TRUE
So all you need to do is (assuming you use a temporary database for sessions) is to encrypt the password the user typed in as pwdencrypt and compare the values.

Hai guys,
Thus far i am using the following statements for encrypting a password variable in sql server 2005
OPEN SYMMETRIC KEY SecureSymmetricKey1
DECRYPTION BY PASSWORD = N’StrongPassword’;
DECLARE @encrypted_str VARBINARY(MAX)
select @encrypted_str=EncryptByKey(Key_GUID(’SecureSymmetricKey1′),@Password)
Is this a good practice or any other approach for doing this…

















