Beispiel #1
0
        public void EncryptBasic()
        {
            ColumnarTranspostition col = new ColumnarTranspostition("ZEBRA");
            var encrypted = col.Encrypt(TextExample);

            Assert.AreEqual("CAHSXTTCPSTANREADSITAKWAB".ToUpper(), encrypted);
        }
Beispiel #2
0
        public void DecryptBasic()
        {
            ColumnarTranspostition col = new ColumnarTranspostition("ZEBRA");
            var encrypted = "CAHSXTTCPSTANREADSITAKWAB";
            var plainText = col.Decrypt(encrypted);

            // Starts with as text could be padded
            Assert.IsTrue(plainText.StartsWith(TextExample, StringComparison.Ordinal));
        }