Example #1
0
 public SecureSocket(BigInteger key, X9ECParameters parameters, AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
     : base(addressFamily, socketType, protocolType)
 {
     this.key = key;
     this.parameters = parameters;
 }
Example #2
0
        public new void Connect(EndPoint remoteEP)
        {
            base.Connect(remoteEP);
            parameters = X9ECParameters.GetByName(ReceiveString(this));

            if (parameters == null)
            {
                base.Disconnect(false);
                return;
            }

            SendPoint(this, parameters.G * key);
            secret = ReceivePoint(this) * key;
            byte[] tmp = secret.X.ToBigInteger().ToByteArray();
            Array.Resize<byte>(ref tmp, 16);
            cipher = new Rijndael(tmp);
            initializationVector = secret.Y.ToBigInteger().ToByteArray();
            Console.WriteLine(secret);
        }
Example #3
0
 public SecureSocket(BigInteger key, X9ECParameters parameters)
     : this(key, parameters, AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
 {
 }