Пример #1
0
        public void RsaShouldDecryptCorrectly(ulong cipherMessage, ulong d, ulong p, ulong q, ulong e, ulong expectedMessage)
        {
            //arrange
            var encryptionResult = new RSAEncryptionResult()
            {
                CipherText = cipherMessage,
                SecretKey  = (d, 0, 0),
                PublicKey  = (p * q, e)
            };
            //act
            var actualDecryptionResult = _rsaCipher.DeCrypt(encryptionResult);

            //assert
            Assert.Equal(expectedMessage, actualDecryptionResult);
        }