예제 #1
0
        public void TestDecryptWithCompress()
        {
            byte[] bytesCompressed = Decryption.DecryptNoDecompress(this.BytesToDecrypt, 21u, this.Key, this.IV);
            byte[] bytesDecrypted  = Decryption.Decompress(bytesCompressed, 13);
            string decryptedString = Encoding.ASCII.GetString(bytesDecrypted);

            Assert.AreEqual(decryptedString, this.Decrypted);
        }
예제 #2
0
        public void TestConsistency()
        {
            byte[] bytesDecrypted1  = Decryption.Decrypt(this.BytesToDecrypt, 13u, this.Key, this.IV);
            string decryptedString1 = Encoding.ASCII.GetString(bytesDecrypted1);

            byte[] bytesCompressed  = Decryption.DecryptNoDecompress(this.BytesToDecrypt, 21u, this.Key, this.IV);
            byte[] bytesDecrypted2  = Decryption.Decompress(bytesCompressed, 13);
            string decryptedString2 = Encoding.ASCII.GetString(bytesDecrypted2);

            Assert.AreEqual(decryptedString1, decryptedString2);
        }