Has anyone worked with storing alphanumeric passwords as binary fields in databases? I have worked up the following command to convert an NVARCHAR field to a BINARY type and it seems to work fine.
UPDATE USERS SET USERPASS=CAST(CAST('TEST' AS NCHAR(5)) AS BINARY) WHERE USERID='USER1
But, I can just as easily convert it back to NVARCHAR and obtain the password with this command:
SELECT CAST(CAST(USERPASS AS NCHAR(20)) AS NVARCHAR(20)) FROM USERS WHERE USERID='USER1'
I guess my question is how can I encrypt the password to make it more difficult to convert back to NVARCHAR?
UPDATE USERS SET USERPASS=CAST(CAST('TEST' AS NCHAR(5)) AS BINARY) WHERE USERID='USER1
But, I can just as easily convert it back to NVARCHAR and obtain the password with this command:
SELECT CAST(CAST(USERPASS AS NCHAR(20)) AS NVARCHAR(20)) FROM USERS WHERE USERID='USER1'
I guess my question is how can I encrypt the password to make it more difficult to convert back to NVARCHAR?