sockscape/server/Encryption/KeyExchange.cs

22 lines
593 B
C#
Raw Normal View History

2017-05-17 21:06:16 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Numerics;
using Square;
2017-05-17 21:06:16 +00:00
namespace CircleScape.Encryption {
class KeyExchange {
private BigInteger Secret;
public BigInteger Generator { get; private set; } = 2;
2017-05-17 21:06:16 +00:00
public BigInteger Modulus { get; private set; }
public BigInteger PrivateKey { get; private set; } = BigInteger.MinusOne;
2017-05-17 21:06:16 +00:00
public KeyExchange() {
Secret = RNG.NextPrime(512 / 8);
Modulus = RNG.NextPrime(512 / 8);
}
2017-05-17 21:06:16 +00:00
}
}