KeyExchangeDiffieHellmanGroup14Sha1.cs 1.6 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-group14-sha1" algorithm implementation.
  13. /// </summary>
  14. internal class KeyExchangeDiffieHellmanGroup14Sha1 : KeyExchangeDiffieHellmanGroupSha1
  15. {
  16. /// <summary>
  17. /// Gets algorithm name.
  18. /// </summary>
  19. public override string Name
  20. {
  21. get { return "diffie-hellman-group14-sha1"; }
  22. }
  23. public override BigInteger GroupPrime
  24. {
  25. get
  26. {
  27. BigInteger prime;
  28. var secondOkleyGroup = "00FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF";
  29. BigInteger.TryParse(secondOkleyGroup, System.Globalization.NumberStyles.AllowHexSpecifier, CultureInfo.CurrentCulture, out prime);
  30. return prime;
  31. }
  32. }
  33. }
  34. }