Esempio n. 1
0
        public void Test()
        {
            Random rand             = new Random();
            AsymmetricEncryption ae = new AsymmetricEncryption();

            for (int i = 0; i < 100; i++)
            {
                byte[] data = new byte[10000];
                rand.NextBytes(data);
                string text       = data.ToBase64String();
                string ciphertext = ae.EncryptToString(text);
                string plaintext  = ae.DecryptToString(ciphertext);
                Assert.AreEqual(text, plaintext);
            }
        }