コード例 #1
0
        public void EncryptStringUsingRijndael()
        {
            string s = null;

            CryptService crip = new CryptService(CryptProvider.Rijndael);

            crip.Key = key2;

            // Vai gerar a string 9p4GFRFMviNj2EofPB2hRZcbgrgi3SrJddPsxw2ukcxHx7b3TZUJO6t+0oEVaLOI
            s = crip.Encrypt("Exemplo de criptografia usando Rijndael.");

            Assert.IsNotNull(s);
        }
コード例 #2
0
        public void EncryptStringUsingDES()
        {
            string s = null;

            CryptService crip = new CryptService(CryptProvider.DES);

            crip.Key = key1;

            // Vai gerar a string XY0tce7dmMFhL31KjdPazmyWK6lA8Ueecj3NjzfJ+HRdTci8+n1yGg==
            s = crip.Encrypt("Exemplo de criptografia usando DES.");

            Assert.IsNotNull(s);
        }