Ejemplo n.º 1
0
        public static string decrypt(string cipher, string key)
        {
            BCEngine bcEngine = new BCEngine(new TwofishEngine(), Encoding.ASCII);

            bcEngine.SetPadding(new Pkcs7Padding());
            return(bcEngine.Decrypt(cipher, key));
        }
Ejemplo n.º 2
0
        public static string encrypt(string plain, string key)
        {
            BCEngine bcEngine = new BCEngine(new TwofishEngine(), Encoding.ASCII);

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