KeyExchangeDiffieHellmanGroup1Sha1.cs 1.3 KB

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