public void DecryptTest() { RsaKey key = null; // TODO: Initialize to an appropriate value RsaCipher target = new RsaCipher(key); // TODO: Initialize to an appropriate value byte[] data = null; // TODO: Initialize to an appropriate value byte[] expected = null; // TODO: Initialize to an appropriate value byte[] actual; actual = target.Decrypt(data); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public byte[] DecryptSsh1(BigInteger e, BigInteger n, BigInteger encryptedChallenge, byte[] sessionId) { var decryptKey = GetKey(e, n); if (decryptKey == null) { return null; } RsaCipher cipher = new RsaCipher((RsaKey)decryptKey.Key.Key); byte[] decryptedChallenge = cipher.Decrypt(encryptedChallenge.ToByteArray().Reverse().ToArray()); var md5 = HashAlgorithmProvider.OpenAlgorithm(HashAlgorithmNames.Md5); byte[] response; CryptographicBuffer.CopyToByteArray(md5.HashData(CryptographicBuffer.CreateFromByteArray(decryptedChallenge.Concat(sessionId).ToArray())), out response); return response; }