예제 #1
0
        public void DecodeBlocksFromBinaryTests(string codedFilePath, string key, string expected)
        {
            DataEncryptionStandard des = new DataEncryptionStandard();
            var actual = des.convertBinaryToAscii(des.ConvertHexToBits(des.DecryptFromFile(codedFilePath, key)));

            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        public void DESDecodeTests(string text, string key, string expected)
        {
            DataEncryptionStandard des = new DataEncryptionStandard();
            var actual = des.convertBinaryToAscii(des.ConvertHexToBits(des.Decrypt(text, key)));

            Assert.AreEqual(expected, actual);
        }
예제 #3
0
        public void CodeBlocksFromBinaryTests(string decodedFilePath, string key, string expected)
        {
            DataEncryptionStandard des = new DataEncryptionStandard();
            var actual = des.EncryptFromFile(decodedFilePath, key);

            Assert.AreEqual(expected, actual);
        }
예제 #4
0
        public void DESCodeTests(string text, string key, string expected)
        {
            DataEncryptionStandard des = new DataEncryptionStandard();
            var actual = des.Encrypt(text, key);

            Assert.AreEqual(expected, actual);
        }