public RabinEncryptionStrategy(string input, RabinKey key)
 {
     if (input == "")
     {
         throw new ArgumentException("Введите сообщение для шифрования/дешифрации");
     }
     this.input = input;
     this.key = key;
     this.encoder = new UTF8Encoding();
 }
Exemple #2
0
 public RabinEncryptionStrategy(string input, RabinKey key)
 {
     if (input == "")
     {
         throw new ArgumentException("Введите сообщение для шифрования/дешифрации");
     }
     this.input   = input;
     this.key     = key;
     this.encoder = new UTF8Encoding();
 }
Exemple #3
0
            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);
            }
            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);
            }