示例#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));
        }
示例#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));
        }