Esempio n. 1
0
        /// Encrypts the given [data] with AES using the specified [key].
        public static byte[] encryptStringWithAes(String data, KeyParameter key)
        {
            AEScoder coder = new AEScoder(key);

            return(coder.encode(System.Text.Encoding.UTF8.GetBytes(data)));
        }
Esempio n. 2
0
        /// Decrypts the given [data] with AES using the specified [key].
        public static byte[] decryptWithAes(byte[] data, KeyParameter key)
        {
            AEScoder coder = new AEScoder(key);

            return(coder.decode(data));
        }