Ejemplo n.º 1
0
        /// <param name="input">需要加密的明文</param>
        /// <param name="key">密钥</param>
        /// <returns>Message 密文</returns>
        public static byte[] Encrypt(byte[] input, int offset, int len, byte[] key)
        {
            TeaCrypt crypter = new TeaCrypt();

            crypter.header = true;
            return(crypter.Encrypt0(input, offset, len, key));
        }
Ejemplo n.º 2
0
        /// <param name="input">需要被解密的密文</param>
        /// <param name="key">密钥</param>
        /// <returns> Message 已解密的消息</returns>
        public static byte[] Decrypt(byte[] input, byte[] key)
        {
            TeaCrypt crypter = new TeaCrypt();

            crypter.header = true;
            return(crypter.Decrypt0(input, key));
        }