Ejemplo n.º 1
0
        public static string EncryptPassword(string password, string seed, bool new_ver)
        {
            long num = 1073741823L;

            if (!new_ver)
            {
                num = 33554431L;
            }
            if (password == null || password.Length == 0)
            {
                return(password);
            }
            long[] array  = Crypt.Hash(seed);
            long[] array2 = Crypt.Hash(password);
            long   num2   = (array[0] ^ array2[0]) % num;
            long   num3   = (array[1] ^ array2[1]) % num;

            if (!new_ver)
            {
                num3 = num2 / 2L;
            }
            char[] array3 = new char[seed.Length];
            for (int i = 0; i < seed.Length; i++)
            {
                double num4 = Crypt.rand(ref num2, ref num3, num);
                array3[i] = (char)(Math.Floor(num4 * 31.0) + 64.0);
            }
            if (new_ver)
            {
                char c = (char)Math.Floor(Crypt.rand(ref num2, ref num3, num) * 31.0);
                for (int j = 0; j < array3.Length; j++)
                {
                    char[] expr_C6_cp_0 = array3;
                    int    expr_C6_cp_1 = j;
                    expr_C6_cp_0[expr_C6_cp_1] ^= c;
                }
            }
            return(new string(array3));
        }
Ejemplo n.º 2
0
        public static string EncryptPassword(string password, string seed, bool new_ver)
        {
            long num = 1073741823L;

            if (!new_ver)
            {
                num = 33554431L;
            }
            if (password != null && password.Length != 0)
            {
                long[] array  = Crypt.Hash(seed);
                long[] array2 = Crypt.Hash(password);
                long   num2   = (array[0] ^ array2[0]) % num;
                long   num3   = (array[1] ^ array2[1]) % num;
                if (!new_ver)
                {
                    num3 = num2 / 2L;
                }
                char[] array3 = new char[seed.Length];
                for (int i = 0; i < seed.Length; i++)
                {
                    double num4 = Crypt.rand(ref num2, ref num3, num);
                    array3[i] = (char)(Math.Floor(num4 * 31.0) + 64.0);
                }
                if (new_ver)
                {
                    char c = (char)Math.Floor(Crypt.rand(ref num2, ref num3, num) * 31.0);
                    for (int j = 0; j < array3.Length; j++)
                    {
                        char[] array4;
                        IntPtr intPtr;
                        (array4 = array3)[(int)(intPtr = (IntPtr)j)] = (char)(array4[(int)intPtr] ^ c);
                    }
                }
                return(new string(array3));
            }
            return(password);
        }