Example #1
0
        public string AESEncryption(string plain, string key, bool fips = false)
        {
            BCEngine bcEngine = new BCEngine(new AesEngine(), Encoding.ASCII);

            bcEngine.SetPadding(null);
            return(bcEngine.Encrypt(plain, key));
        }
Example #2
0
        public string AESEncryption(string plain, string key, bool fips)
        {
            Console.WriteLine("AESEncryption: {0}; key: {1})", plain, key);
            _padding = pkcs;
            BCEngine bcEngine = new BCEngine(new AesEngine(), _encoding);

            bcEngine.SetPadding(_padding);
            //return bcEngine.Encrypt(plain, key);
            String resultStr = bcEngine.Encrypt(plain, key);

            Console.WriteLine("result length: {0}. String: {1}", resultStr.Length, resultStr);
            return(resultStr);
        }