Thursday, March 29, 2012

Create table with Encrypted passwords

Hello,
I need to create one table where i want to add records
with users and corresponding passwords but these passwords
must appear encrypted.
How can i do this? and if it is possible how can i decrypt
these passwords.
I need to do it but i cant put in risk the security of my
databases. Is it possible?
Best regards
This link will give you an overview of column level encryption:
http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=22
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message
news:1c14201c45211$ab44f000$a101280a@.phx.gbl...
Hello,
I need to create one table where i want to add records
with users and corresponding passwords but these passwords
must appear encrypted.
How can i do this? and if it is possible how can i decrypt
these passwords.
I need to do it but i cant put in risk the security of my
databases. Is it possible?
Best regards
|||Hi,
The PWDENCRYPT and PWDCOMPARE functions are used to encrypt and compare DATA
passwords are not visible in anywhere in the database.
FYI, PWDENCRYPT and PWDCOMPARE are undocumented functions , so it can change
in future versions.
Sample code to create table and encypt the password column and usage:-
Create table users ( userid int identity (1,1) not null,
pswd varbinary (128))
-- INSERTING ENCRYPED value
-- hard coded string should be replace
-- by a text box value from screen
Insert into users values (PWDENCRYPT ('hari prasad'))
declare @.pwd varbinary(128) , @.chk tinyint
-- the dencryption phase
select @.pwd=pswd from users where userid = 1
-- comparing : 1 is success, 0 is not
select @.chk=PWDCOMPARE ('hari prasad',@.pwd)
if @.chk ! = 1
Print 'Wrong Password Entered! Try Again'
else
Print 'Login Successfully'
Do a check inside application , if the value returned is "1" allow to
login.
Thanks
Hari
MCDBA
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message
news:1c14201c45211$ab44f000$a101280a@.phx.gbl...
> Hello,
> I need to create one table where i want to add records
> with users and corresponding passwords but these passwords
> must appear encrypted.
> How can i do this? and if it is possible how can i decrypt
> these passwords.
> I need to do it but i cant put in risk the security of my
> databases. Is it possible?
> Best regards
|||Thanks Narayana
Best regards

>--Original Message--
>This link will give you an overview of column level
encryption:
>http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=22
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
>"CC&JM" <anonymous@.discussions.microsoft.com> wrote in
message
>news:1c14201c45211$ab44f000$a101280a@.phx.gbl...
>Hello,
>I need to create one table where i want to add records
>with users and corresponding passwords but these passwords
>must appear encrypted.
>How can i do this? and if it is possible how can i decrypt
>these passwords.
>I need to do it but i cant put in risk the security of my
>databases. Is it possible?
>Best regards
>
>.
>

No comments:

Post a Comment