Exemplo n.º 1
0
        public int Aes()
        {
            var res = _aesEncryptionService.Encrypt(toCompress);
            var str = _aesEncryptionService.Decrypt(res.ToArray());

            return(str.Length);
        }
        public void EncyrptAndDecryptData()
        {
            string original = "Here is some data to encrypt!";

            var encryptionService = new AESEncryptionService();

            var encrypted = encryptionService.Encrypt(original);
            var decrypted = encryptionService.Decrypt(encrypted);

            Assert.AreEqual(original, decrypted);
        }
Exemplo n.º 3
0
        public void EncryptDecryptTest()
        {
            string testContent  = "Hello World!!!";
            var    bytesContent = Encoding.UTF8.GetBytes(testContent);

            AESEncryptionService encryptionService = new AESEncryptionService("testpwd");

            var encrypted = encryptionService.Encrypt(bytesContent);
            var decrypted = encryptionService.Decrypt(encrypted.ToArray());
            var str       = Encoding.UTF8.GetString(decrypted);

            str.Should().Be(testContent);
        }
 public void Encrypt()
 {
     encryptionService.Encrypt("1234567890123456");
 }