Beispiel #1
0
        public static string Decode(string EncodeText)
        {
            byte[] EncodeBuffer     = ToBytes(EncodeText);
            byte[] DecodeBuffer     = AES.AESDecrypt(EncodeBuffer, key, vector);
            byte[] DecompressBuffer = new byte[] { };
            DecompressBuffer = Compress.Decompress(DecodeBuffer);

            return(Encoding.UTF8.GetString(DecompressBuffer));
        }
Beispiel #2
0
        public static string Encode(string OriginalText)
        {
            byte[] OriginalBuffer   = Encoding.UTF8.GetBytes(OriginalText);
            byte[] CompressedBuffer = Compress.CompressZip(OriginalBuffer);
            byte[] EncodeBuffer     = AES.AESEncrypt(CompressedBuffer, key, vector);
            string EncodeString     = String.Empty;

            foreach (var word in EncodeBuffer)
            {
                EncodeString += TudouChar[word];
            }

            return(EncodeString);
        }