2
0

Cipher.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. namespace Renci.SshNet.TestTools.OpenSSH
  2. {
  3. public sealed class Cipher
  4. {
  5. public static readonly Cipher TripledesCbc = new Cipher("3des-cbc");
  6. public static readonly Cipher Aes128Cbc = new Cipher("aes128-cbc");
  7. public static readonly Cipher Aes192Cbc = new Cipher("aes192-cbc");
  8. public static readonly Cipher Aes256Cbc = new Cipher("aes256-cbc");
  9. public static readonly Cipher RijndaelCbc = new Cipher("rijndael-cbc@lysator.liu.se");
  10. public static readonly Cipher Aes128Ctr = new Cipher("aes128-ctr");
  11. public static readonly Cipher Aes192Ctr = new Cipher("aes192-ctr");
  12. public static readonly Cipher Aes256Ctr = new Cipher("aes256-ctr");
  13. public static readonly Cipher Aes128Gcm = new Cipher("aes128-gcm@openssh.com");
  14. public static readonly Cipher Aes256Gcm = new Cipher("aes256-gcm@openssh.com");
  15. public static readonly Cipher Arcfour = new Cipher("arcfour");
  16. public static readonly Cipher Arcfour128 = new Cipher("arcfour128");
  17. public static readonly Cipher Arcfour256 = new Cipher("arcfour256");
  18. public static readonly Cipher BlowfishCbc = new Cipher("blowfish-cbc");
  19. public static readonly Cipher Cast128Cbc = new Cipher("cast128-cbc");
  20. public static readonly Cipher Chacha20Poly1305 = new Cipher("chacha20-poly1305@openssh.com");
  21. public Cipher(string name)
  22. {
  23. Name = name;
  24. }
  25. public string Name { get; }
  26. public override bool Equals(object? obj)
  27. {
  28. if (obj == null)
  29. {
  30. return false;
  31. }
  32. if (obj is Cipher otherCipher)
  33. {
  34. return otherCipher.Name == Name;
  35. }
  36. return false;
  37. }
  38. public override int GetHashCode()
  39. {
  40. return Name.GetHashCode();
  41. }
  42. public override string ToString()
  43. {
  44. return Name;
  45. }
  46. }
  47. }