Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
roymanish1982 #1
Member since Mar 2011 · 20 posts
Group memberships: Members
Show profile · Link to this post
Subject: Non-SASL Authentication
Matrix.Util.Sha1HashHex  is Missing in MatriX build ?

i need to decrypt the Digest part

Thanks
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I have uploaded a new dll to the latest downloads where this function is public. Please download it.

Alex
Avatar
roymanish1982 #3
Member since Mar 2011 · 20 posts
Group memberships: Members
Show profile · Link to this post
Still i didnt found the Class
Matrix.Util.Sha1HAshHex its still showing

Matrix.Util.Time


Please help me
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
  1. using System.Text;
  2. using System.Security.Cryptography;
  3.  
  4. public static string Sha1HashHex(string pass)
  5. {
  6.     var hash = Sha1HashBytes(pass);
  7.     return HexToString(hash);
  8. }
  9.  
  10. public static byte[] Sha1HashBytes(string pass)
  11. {
  12.     var bytes = Encoding.UTF8.GetBytes(pass);
  13.     return Sha1HashBytes(bytes);
  14. }
  15.  
  16. public static byte[] Sha1HashBytes(byte[] pass)
  17. {
  18.     using (var sha = new SHA1Managed())
  19.     {
  20.         return sha.ComputeHash(pass);
  21.     }
  22. }
  23.  
  24. public static string HexToString(byte[] buf)
  25. {
  26.     var sb = new StringBuilder();
  27.     foreach (byte b in buf)
  28.     {
  29.         sb.Append(b.ToString("x2"));
  30.     }
  31.     return sb.ToString();
  32. }
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS