Esempio n. 1
0
 // Token: 0x0600018B RID: 395 RVA: 0x0000B89C File Offset: 0x00009A9C
 public static byte[] Encrypt(byte[] original, byte[] key)
 {
     return(new TripleDESCryptoServiceProvider
     {
         Key = SecurityHelper.MakeMD5(key),
         Mode = CipherMode.ECB
     }.CreateEncryptor().TransformFinalBlock(original, 0, original.Length));
 }
Esempio n. 2
0
        // Token: 0x06000189 RID: 393 RVA: 0x0000B7F4 File Offset: 0x000099F4
        public static string GetMD5(string password)
        {
            MD5CryptoServiceProvider md5CryptoServiceProvider = new MD5CryptoServiceProvider();

            byte[]        bytes         = Encoding.UTF8.GetBytes(password);
            byte[]        array         = SecurityHelper.MakeMD5(bytes);
            StringBuilder stringBuilder = new StringBuilder();

            foreach (byte b in array)
            {
                stringBuilder.Append(b.ToString("x2"));
            }
            return(stringBuilder.ToString());
        }
Esempio n. 3
0
        // Token: 0x0600018C RID: 396 RVA: 0x0000B8DC File Offset: 0x00009ADC
        public static byte[] Decrypt(byte[] encrypted, byte[] key)
        {
            byte[] result = new byte[0];
            TripleDESCryptoServiceProvider tripleDESCryptoServiceProvider = new TripleDESCryptoServiceProvider();

            tripleDESCryptoServiceProvider.Key  = SecurityHelper.MakeMD5(key);
            tripleDESCryptoServiceProvider.Mode = CipherMode.ECB;
            try
            {
                result = tripleDESCryptoServiceProvider.CreateDecryptor().TransformFinalBlock(encrypted, 0, encrypted.Length);
            }
            catch
            {
            }
            return(result);
        }