encrypt and compare password in sql server

علی ذوالفقار
1404/05/18 08:51:03 (12)
use PWDENCRYPT to encrypt password 
use PWDCOMPARE to compare pasword 

select PWDENCRYPT('123')
select PWDCOMPARE('123', PWDENCRYPT('123') , 0 )

insert into tbl_users ( email , password ) values ( 'me@mysite.com' , PWDENCRYPT('MyPassword') )         

select * from tbl_users where email = @email and PWDCOMPARE( @password , PWDENCRYPT(password) , 0 ) = 1

Back