Exemplo n.º 1
0
        public static string SerpentDecryption(byte[] cipher, byte[] key)
        {
            SerpentAlgo bcEngine = new SerpentAlgo(new SerpentEngine(), ASCIIEncoding.ASCII);

            bcEngine.SetPadding(new Pkcs7Padding());
            return(bcEngine.Decrypt(cipher, key));
        }
Exemplo n.º 2
0
        public static byte[] SerpentEncryption(string plain, byte[] key)
        {
            SerpentAlgo bcEngine = new SerpentAlgo(new SerpentEngine(), ASCIIEncoding.ASCII);

            bcEngine.SetPadding(new Pkcs7Padding());
            return(bcEngine.Encrypt(plain, key));
        }