November 24, 2008 at 1:25 am
hi, i've been requested to encrypt a password column in a table on our database. This is the first time i'm venturing into encryption and im doing lots of reading work, problem is i dont understand the whole thing and i need to have a release out asap. can anyone help me out with a script to encrypt the password column in the following table. thanks guys...
DECLARE @AppPasswords TABLE(PasswordID INT IDENTITY(1,1), UserID INT, Password VARCHAR(50), PwdDateCreated DATETIME)
INSERT INTO @AppPasswords (
[UserID],
[Password],
[PwdDateCreated]
) VALUES (
1,
'fakepassword',
'2008-11-24 10:16:44.461' )
SELECT * FROM @AppPasswords
November 24, 2008 at 1:49 am
mmm, looks like hashing the column is the preferred method...
any advice and code examples?
November 24, 2008 at 2:07 am
no worries people. i found a solution.
:w00t:
November 24, 2008 at 10:08 am
Care to post up your solution in case anyone else sees this thread and has a similar question?
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 25, 2008 at 1:40 am
DECLARE @AppPasswords TABLE(PasswordID INT IDENTITY(1,1), UserID INT, Password VARCHAR(50), PwdDateCreated DATETIME)
INSERT INTO @AppPasswords (
[UserID],
[Password],
[PwdDateCreated]
) VALUES (
1,
HashBytes('MD5', 'fakepassword'),
'2008-11-24 10:16:44.461' )
SELECT * FROM @AppPasswords
IF EXISTS (SELECT * FROM @AppPasswords WHERE
[UserID] = 1 AND [Password] =
HashBytes('MD5', 'fakepassword'))
BEGIN
SELECT 'Password Matched'
END
ELSE
BEGIN
SELECT 'Password Did Not Match'
END
SELECT * FROM [@AppPasswords]
November 25, 2008 at 8:26 am
Thanks 😉
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply