public void RSA_Encrypt_Decrypt_Test() { var keyPair = Rsa.CreateKeyPair(RSAKeySizes.Size1024); var testData = "Test Test Hello"; var encrypted = Rsa.Encrypt(keyPair.PublicKey, testData); var decrypted = Encoding.UTF8.GetString(Rsa.Decrypt(keyPair.PrivateKey, encrypted)); Assert.AreEqual(testData, decrypted); }