Ask a Question related to ASP.NET Security, Design and Development.
-
Juan Irigoyen #1
Check HASH Password in WSE 2.0. Please Help.
By example, the next code work well.
Client
token = new UsernameToken("juan", "1111", PasswordOption.TextPlain );
Server
protected override string AuthenticateToken( UsernameToken token )
{
ncadena = '1111';
return ncadena;
}
This sample go well but if the password is SendHashed the next code donīt
working
Client
token = new UsernameToken("juan", "1111", PasswordOption.SendHashed );
Server
protected override string AuthenticateToken( UsernameToken token )
{
string ncadena =
HashPassword(Convert.ToBase64String(token.Nonce),t oken.Created,"1111");
return ncadena;
}
private string HashPassword (string nnonce, DateTime nfecha, string
npassword)
{
byte[] n = System.Text.Encoding.UTF8.GetBytes(nnonce);
byte[] c = System.Text.Encoding.UTF8.GetBytes(nfecha.ToString ());
byte[] p = System.Text.Encoding.UTF8.GetBytes(npassword);
byte[] toBeDiges = new byte[n.Length + c.Length + p.Length];
Array.Copy(n,0,toBeDiges,0,n.Length);
Array.Copy(c,0,toBeDiges,n.Length,c.Length);
Array.Copy(p,0,toBeDiges,(n.Length + c.Length),p.Length);
Array.Clear(p,0,p.Length);
SHA1 hash = SHA1.Create();
byte[] digest = hash.ComputeHash(toBeDiges);
Array.Clear(toBeDiges,0,toBeDiges.Length);
return Convert.ToBase64String(digest);
}
I donīt find example for this problem. Thanks.
Juan Irigoyen Guest
-
Cannot check hashed password
Hello, When users enter their email address and password in the login form, a login check is made using the following code. (The password is... -
How do I can check a password Hash in WSE 2.0
By example Client token = new UsernameToken("juan", "1111", PasswordOption.TextPlain ); Server protected override string... -
How do I check the password hash receive a token in WSE 2.0
By example Client token = new UsernameToken("juan", "1111", PasswordOption.TextPlain ); Server protected override string... -
How do I can receive a token with password hash in WSE 2.0
By example Client token = new UsernameToken("juan", "1111", PasswordOption.TextPlain ); Server protected override string... -
MD5 System Password check with PHP
Hello everybody, I want to authenticate my user from web with PHP script. The user's passwords are stored in System as MD5 format (in...



Reply With Quote

