Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1336334918.28120.YahooMailNeo@web161303.mail.bf1.yahoo.com>
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

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.