Share Blog

Friday, March 14, 2014

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

--first  create table LOGINDETAILSS in database ENCPTPASSWARD.....----

CREATE DATABASE ENCPTPASSWARD
 use ENCPTPASSWARD
 create table LOGINDETAILSS (EmailId nvarchar(50) primary key,Password nvarchar(50))

 --Insert Encrypted Password in Sql Server:-


  insert into LOGINDETAILSS values('hrngaitmartindia.com',encryptbypassphrase('sunil','kumar12345'))

  -- fetch  data from table without Decrypted form

  select * from  LOGINDETAILSS


 -- Show data with Decrypted form


  select EmailId,CONVERT(varchar(max),Decryptbypassphrase('sunil',Password)) as Password    from LOGINDETAILSS


No comments:

Post a Comment