Exemplo n.º 1
0
 public byte[] CreateServerKeyPacket()
 {
     _clientIv = new byte[8];
     _serverIv = new byte[8];
     string P = "E7A69EBDF105F2A6BBDEAD7E798F76A209AD73FB466431E2E7352ED262F8C558F10BEFEA977DE9E21DCEE9B04D245F300ECCBBA03E72630556D011023F9E857F";
     string G = "05";
     _keyExchange = new OpenSSL.DH(OpenSSL.BigNumber.FromHexString(P), OpenSSL.BigNumber.FromHexString(G));
     _keyExchange.GenerateKeys();
     return GeneratePacket(_serverIv, _clientIv, P, G, _keyExchange.PublicKey.ToHexString());
 }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new DHKeyExchange.
        /// </summary>
        /// <param name="serverIv">The server Iv.</param>
        /// <param name="clientIv">The clientIv.</param>
        public DHKeyExchange(byte[] serverIv, byte[] clientIv)
        {
            _clientIv = clientIv != null ? clientIv : new byte[8];
            _serverIv = serverIv != null ? serverIv : new byte[8];

            P = "E7A69EBDF105F2A6BBDEAD7E798F76A209AD73FB466431E2E7352ED262F8C558F10BEFEA977DE9E21DCEE9B04D245F300ECCBBA03E72630556D011023F9E857F";
            G = "05";

            _keyExchange = new OpenSSL.DH(OpenSSL.BigNumber.FromHexString(P), OpenSSL.BigNumber.FromHexString(G));
            _keyExchange.GenerateKeys();
        }
Exemplo n.º 3
0
            public byte[] CreateServerKeyPacket()
            {
                _clientIv = new byte[8];
                _serverIv = new byte[8];
                string P = "E7A69EBDF105F2A6BBDEAD7E798F76A209AD73FB466431E2E7352ED262F8C558F10BEFEA977DE9E21DCEE9B04D245F300ECCBBA03E72630556D011023F9E857F";
                string G = "05";

                _keyExchange = new OpenSSL.DH(OpenSSL.BigNumber.FromHexString(P), OpenSSL.BigNumber.FromHexString(G));
                _keyExchange.GenerateKeys();
                return(GeneratePacket(_serverIv, _clientIv, P, G, _keyExchange.PublicKey.ToHexString()));
            }