KeyExchangeDiffieHellmanGroup1Sha1.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Renci.SshNet.Common;
  2. using System.Globalization;
  3. namespace Renci.SshNet.Security
  4. {
  5. /// <summary>
  6. /// Represents "diffie-hellman-group1-sha1" algorithm implementation.
  7. /// </summary>
  8. public class KeyExchangeDiffieHellmanGroup1Sha1 : KeyExchangeDiffieHellmanGroupSha1
  9. {
  10. private const string SecondOkleyGroup = @"00FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF";
  11. /// <summary>
  12. /// Gets algorithm name.
  13. /// </summary>
  14. public override string Name
  15. {
  16. get { return "diffie-hellman-group1-sha1"; }
  17. }
  18. /// <summary>
  19. /// Gets the group prime.
  20. /// </summary>
  21. /// <value>
  22. /// The group prime.
  23. /// </value>
  24. public override BigInteger GroupPrime
  25. {
  26. get
  27. {
  28. BigInteger prime;
  29. BigInteger.TryParse(SecondOkleyGroup, NumberStyles.AllowHexSpecifier, CultureInfo.CurrentCulture, out prime);
  30. return prime;
  31. }
  32. }
  33. }
  34. }