Пример #1
0
        private static string Decrypt(byte[] buffer, long size)
        {
            byte[] temp = new byte[(int)size];
            Array.Copy(buffer, 0, temp, 0, (int)size);
            //remove \final\, later we add final back
            string cipherText = Encoding.ASCII.GetString(temp);

            cipherText = cipherText.Substring(0, cipherText.Length - 7);

            return(XorEncoding.Encrypt(cipherText, XorEncoding.XorType.Type1) + @"\final\");
        }
Пример #2
0
        protected string Decrypt(byte[] buffer, long offset, long size)
        {
            byte[] temp = new byte[(int)size];
            Array.Copy(buffer, 0, temp, 0, (int)size);
            //remove final
            string cipherText = Encoding.ASCII.GetString(temp);

            cipherText = cipherText.Substring(0, cipherText.Length - 7);

            return(XorEncoding.Encrypt(cipherText, XorEncoding.XorType.Type1) + @"\final\");
        }
Пример #3
0
 protected string Encrypt(string plainText)
 {
     return(XorEncoding.Encrypt(plainText, XorEncoding.XorType.Type0));
 }
Пример #4
0
 protected string Decrypt(byte[] buffer, long offset, long size)
 {
     byte[] cipherText = new byte[(int)size];
     Array.Copy(buffer, offset, cipherText, 0, (int)size);
     return(XorEncoding.Encrypt(cipherText, XorEncoding.XorType.Type0));
 }
Пример #5
0
 private static string Encrypt(string plainText)
 {
     return(XorEncoding.Encrypt(plainText, XorEncoding.XorType.Type1) + @"\final\");
 }
Пример #6
0
 protected string Encrypt(string plainText)
 {
     return(XorEncoding.Encrypt(plainText, XorEncoding.XorType.Type1) + @"\final\");
 }