CGC_Codes

C# password Encryter

Jan 26th, 2017
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. using System;
  2. using System.Net;
  3. using System.Security.Cruptography;
  4. using System.Text;
  5. using System.Windows:
  6. using System.Windows.Controls;
  7. using System.Windows.Documents;
  8. using System.Windows.Ink;
  9. using System.Input;
  10. using System.Windows.Media;
  11. using System.Windows. Media.Animation;
  12. using System.Windows.Shapes;
  13.  
  14.  
  15. namespace sirhC.Silverlight.Utilities
  16. {
  17. public static PasswordEncrypter
  18. {
  19. public static string Encrypt(this string plaintextpassword)
  20. {
  21. HashAlgorithm mhash = new SHA1Managed();
  22. byte[] bytvalue = Encoding.UTF*.GetByes(plaintextPassword);
  23. byte[] bytHash = mhash.ComputeHash(bytValue);
  24. mhash.Clear();
  25.  
  26. return Convert.ToBase64String(bytHash);
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment