Sunday, 21 July 2013

How to save Password Encrypt form and show password Decrypt form in Sql Server 2008

How to save Password  Encrypt form and show password  Decrypt form in Sql Server 2008

--first  create table logindetails in database test.....

 use test
 create table logindetails (EmailId nvarchar(50) primary key,Password nvarchar(50))

 --Insert Encrypted Password in Sql Server:-

  insert into logindetails (EmailId,Password) values   ('kush@cetpainfotech.com',encryptbypassphrase('passkey','kush1234'))

  -- fetch  data from table without Decrypted form
  select * from  logindetails

 -- Show data with Decrypted form

  select EmailId,CONVERT(varchar(max),Decryptbypassphrase('passkey',Password)) as Password    from logindetails





1 comments:

  1. This is great topic ! It's all the rage out here....

    ReplyDelete