public void Encrypt() { var key = RcFactory.GenerateKey("alexinea", Encoding.UTF8); var function = RcFactory.Create(RcTypes.RC4, key); var cryptoVal0 = function.Encrypt("image"); BaseConv.ToBase64(cryptoVal0.CipherData).ShouldBe("I2YRaZo="); }
public void Encrypt_ThreeRCX() { var key = RcFactory.GenerateKey("alexinea", Encoding.UTF8); var function = RcFactory.Create(RcTypes.ThreeRCX, key); var cryptoVal0 = function.Encrypt("ABCDDDDDDDDDDDDDDDDDDDDDD"); BaseConv.ToBase64(cryptoVal0.CipherData).ShouldBe("JPTCrl2N6xae4GCEXfzUiSa9YrwSa80HDg=="); }
public void Encrypt() { var key = RcFactory.GenerateKey("alexinea", Encoding.UTF8); var function = RcFactory.Create(RcTypes.RCX, key); var cryptoVal0 = function.Encrypt("ABCDDDDDDDDDDDDDDDDDDDDDD"); BaseConv.ToBase64(cryptoVal0.CipherData).ShouldBe("C+YxcfWRWMVCIjbX21qXcG9OXq25jJTHmw=="); }
public void Decrypt() { var key = RcFactory.GenerateKey("alexinea", Encoding.UTF8); var function = RcFactory.Create(RcTypes.RC4, key); var cryptoVal0 = function.Encrypt("image"); var cryptoVal1 = function.Decrypt(cryptoVal0.CipherData); cryptoVal1.GetOriginalDataDescriptor().GetString().ShouldBe("image"); var cryptoVal2 = function.Decrypt("I2YRaZo=", CipherTextTypes.Base64Text); cryptoVal2.GetOriginalDataDescriptor().GetString().ShouldBe("image"); }
public void Decrypt_ThreeRCX() { var key = RcFactory.GenerateKey("alexinea", Encoding.UTF8); var function = RcFactory.Create(RcTypes.ThreeRCX, key); var cryptoVal0 = function.Encrypt("ABCDDDDDDDDDDDDDDDDDDDDDD"); var cryptoVal1 = function.Decrypt(cryptoVal0.CipherData); cryptoVal1.GetOriginalDataDescriptor().GetString().ShouldBe("ABCDDDDDDDDDDDDDDDDDDDDDD"); var cryptoVal2 = function.Decrypt("JPTCrl2N6xae4GCEXfzUiSa9YrwSa80HDg==", CipherTextTypes.Base64Text); cryptoVal2.GetOriginalDataDescriptor().GetString().ShouldBe("ABCDDDDDDDDDDDDDDDDDDDDDD"); }
public void Decrypt() { var key = RcFactory.GenerateKey("alexinea", Encoding.UTF8); var function = RcFactory.Create(RcTypes.RCX, key); var cryptoVal0 = function.Encrypt("ABCDDDDDDDDDDDDDDDDDDDDDD"); var cryptoVal1 = function.Decrypt(cryptoVal0.CipherData); cryptoVal1.GetOriginalDataDescriptor().GetString().ShouldBe("ABCDDDDDDDDDDDDDDDDDDDDDD"); var cryptoVal2 = function.Decrypt("C+YxcfWRWMVCIjbX21qXcG9OXq25jJTHmw==", CipherTextTypes.Base64Text); cryptoVal2.GetOriginalDataDescriptor().GetString().ShouldBe("ABCDDDDDDDDDDDDDDDDDDDDDD"); }