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