Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sun, 6 May 2012 13:08:38 -0700 (PDT)
From: deepika dutta <deepikadutta_19@...oo.com>
To: "john-dev@...ts.openwall.com" <john-dev@...ts.openwall.com>
Subject: mschap-v2 des bs conversion

I have written the following code for filling B[] with plaintext in bitsliced form. Since the plaintext is same for each layer, so the approach is pretty straight forward. Please go through and see if its fine for you.

void main()
{
    char *plaintext = "hello123";
    ARCH_WORD b[64];
    char temp;
    int i, j, val, cnt;
    temp = j = 0;

    for(i=0; i<8; i++)
       printf("%02x ", plaintext[i]);
    printf("\n");

    for(cnt =0; cnt < 8; cnt++)
    {
        for (i=0; i<8; i++)
        {
            temp = 0x01 & (plaintext[cnt] >> (7 - i));
            if (temp == 0)
                b[j + i] = 0;
            else
                b[j + i] = 1;
        }
        j = j + 8;
        i = 0;
    }
    for (i=0 ;i <64; i++)
        printf ("%02x ", b[i]);
}


 
Cheers,
Deepika
Content of type "text/html" skipped

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ