Dear all,
in registartion time iam saving the password in encrypted fotmat,
but after registaration trying to login with password it was not accepting my credentials
but it was accepting encrypted data so can u give example how to login with encrypted password

Gaurav Kumar AroraPosted Dec 15, 2014, 4:07 PM
Whenever you getting your users registered/enrolled to your website, you must provide some encryption Logic, might be you used some algorithm like MD5, SHA, RSA or any other one. You need to I suggest you to read Cryptography here is the CsharpCorner link: http://www.c-sharpcorner.com/1/60/cryptography-C-Sharp.aspx
I am not providing any code here, as I understood your problem is generic so, you just need to understand the terms/concepts.
Have a great coding!
Wim SturkenboomPosted Sep 17, 2014, 3:42 PM
This is my stored procedure to add a user; sql server encrypts the password.
ALTER PROCEDURE [dbo].[usp_Users_Add]
@pUserName nvarchar(128), -- user name
@pEmailAddress nvarchar(256), -- email address
@pPhonenumber nvarchar(50) = null, -- phone number
@pDefaultGroupID bigint, -- default group ID
@pPassword nvarchar(256), -- password
@pPasswordChangeRequired bit, -- indicates if user has to change password
@pCanLogin bit -- indicates of user can login
AS
BEGIN
insert into Users
(UserName, EmailAddress, PhoneNumber, DefaultGroupID, [Password], fPasswordChangeRequired, fCanLogin)
Values
(@pUserName, @pEmailAddress, @pPhonenumber, @pDefaultGroupID, HASHBYTES('sha2_256',@pPassword), @pPasswordChangeRequired, @pCanLogin)
END
And to check user's credentials; sql server compares the stored password against the hash of the submitted password
ALTER PROCEDURE [dbo].[usp_Users_GetByCredentials]
@pEmailAddress nvarchar(256),
@pPassword nvarchar(256)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT * from Users
left join UserPermissions on FK_userID = PK_userID
where EmailAddress = @pEmailAddress and [Password] = HASHBYTES('sha2_256', @pPassword) and fCanLogin = 'true'
END
Guest UserPosted Sep 17, 2014, 1:01 PM
http://www.c-sharpcorner.com/Blogs/9384/