Пример #1
0
        static private byte[] CreateKeyTable(string pass)  // (void *this, byte *a2)
        {
            if (pass.Length < 8)
            {
                pass = DefaultPassPhrase;
            }
            int pass_len   = pass.Length;
            int hash       = PasskeyHash(pass); // sub_100E0390
            var hash_table = new KeyTableGenerator(hash);

            byte[] table = new byte[0x10000];
            for (int i = 0; i < table.Length; ++i)
            {
                int key = hash_table.Permutate(); // sub_100E06D0
                table[i] = (byte)((byte)pass[i % pass_len] ^ (key >> 16));
            }
            return(table);
        }
Пример #2
0
        static private byte[] CreateKeyTable(string pass)
        {
            if (pass.Length < 8)
            {
                pass = DefaultPassPhrase;
            }
            int  pass_len = pass.Length;
            uint seed     = PasskeyHash(pass);
            var  rng      = new KeyTableGenerator((int)seed);

            byte[] table = new byte[0x10000];
            for (int i = 0; i < table.Length; ++i)
            {
                int key = rng.Rand();
                table[i] = (byte)(pass[i % pass_len] ^ (key >> 16));
            }
            return(table);
        }