public void TestStreamDomains()
        {
            string encrypted = symStreamCipher.DoEncrypt("RC4 ", key1024, "", plainTextStream);

            Assert.IsFalse(symStreamCipher.HasError());
            string decrypted = symStreamCipher.DoDecrypt(" RC4", key1024, "", encrypted);

            Assert.IsFalse(symStreamCipher.HasError());
            Assert.IsTrue(SecurityUtils.compareStrings(decrypted, plainTextStream));
        }
コード例 #2
0
 private void testBulkAlgorithms(string algorithm, string key, string IV)
 {
     for (int i = 0; i < encodings.Length; i++)
     {
         eu.setEncoding(encodings[i]);
         SymmetricStreamCipher symCipher = new SymmetricStreamCipher();
         string encrypted = symCipher.DoEncrypt(algorithm, key, IV, plainText);
         string decrypted = symCipher.DoDecrypt(algorithm, key, IV, encrypted);
         Assert.IsTrue(SecurityUtils.compareStrings(plainText, decrypted));
         True(SecurityUtils.compareStrings(plainText, decrypted), symCipher);
     }
 }