public void Setup() { var x = RandomData(StringSize); toCompress = x.Item1; expectedString = x.Item2; string pwd = "dsdf4zf48ufr4ju4js"; _aesEncryptionService = new AESEncryptionService(pwd); _tripleDesEncryptionService = new TripleDESEncryptionService(pwd); }
public void EncryptDecryptTest() { string testContent = "Hello World!!!"; var bytesContent = Encoding.UTF8.GetBytes(testContent); TripleDESEncryptionService encryptionService = new TripleDESEncryptionService("testpwd"); var encrypted = encryptionService.Encrypt(bytesContent); var decrypted = encryptionService.Decrypt(encrypted.ToArray()); var str = Encoding.UTF8.GetString(decrypted); str.Should().Be(testContent); }
public EncryptedStringUserType() : base(new StringSqlType()) { encryptionService = new TripleDESEncryptionService(); }