Skip to content

Unlocker doesn't need to call des_encrypt_with_sbox 0x20000 * 8 * 2 times #7

@nckstwrt

Description

@nckstwrt

Unlocker does take about ~10 secs to run because of the 0x20000 * 8 * 2 calls to des_encrypt_with_sbox. You can replace those calls with:

void sbox_fast(BYTE* in, BYTE* out)
{
    BYTE out_test[21] = { 0 };

    memset(out, 0, 21);
    out[0] = in[0] ^ 0x2D;

    for (int i = 1; i < 21; i++) 
    {
        des_encrypt_with_sbox(out, out_test, 21);
        out[i] = in[i] ^ out_test[i];
    }
}
...
Then just replace all your loop and thread status code with just:
sbox_fast(output_buffer, data_buffer_ptr);

Then you'll get the same output pretty much instantly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions