public void EncryptionTest() { // dlugosc stringa nie moze byc zbyt duza string originalString = "qwerty1234567890"; RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(); string pubkey = rsa.ToXmlString(false); string prikey = rsa.ToXmlString(true); byte[] encrypted = PerformanceLogger.RSAEncrypt(Encoding.Unicode.GetBytes(originalString), pubkey); byte[] decrypted = PerformanceLogger.RSADecrypt(encrypted, prikey); string processedString = Encoding.Unicode.GetString(decrypted); Assert.AreEqual(originalString, processedString); }