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);
        }
Esempio n. 2
0
        public void Setup()
        {
            var x = RandomData(StringSize);

            toCompress     = x.Item1;
            expectedString = x.Item2;
            string pwd = "dsdf4zf48ufr4ju4js";

            _aesEncryptionService       = new AESEncryptionService(pwd);
            _tripleDesEncryptionService = new TripleDESEncryptionService(pwd);
        }
Esempio 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);
        }