public RSACryptoTransform() { Random random = new Random(123);// TODOL seed BigInteger p = Program.RandomPrime(128, 5, random); BigInteger q = Program.RandomPrime(128, 5, random); _n = p * q; BigInteger phi_n = (p - 1) * (q - 1); if (!TryFindExponents(phi_n, out _e, out _d)) { throw new Exception(); // TODOL regenerate p, q } _inputBlockSize = Math.Min(p.BytesCount(), q.BytesCount()) - 1; _outputBlockSize = _n.BytesCount(); _inputBuf = new byte[_inputBlockSize + 1]; }