public RabinEncryptionStrategy(string input, RabinKey key) { if (input == "") { throw new ArgumentException("Введите сообщение для шифрования/дешифрации"); } this.input = input; this.key = key; this.encoder = new UTF8Encoding(); }
public void GenerateKeys() { BigInteger p = primes.Next(x => x % 8 == 3); BigInteger q = primes.Next(x => x % 8 == 7 && x != p); BigInteger n = p * q; PublicKey = new RabinKey(n); PrivateKey = new RabinKey(p, q); }