Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAG5=z92KC_qCf-bw664nJa2x3-pDdpm6QBwpVCZwftAezTTs1A@mail.gmail.com>
Date: Sun, 17 Jun 2012 17:47:00 +0530
From: Piyush Mittal <piyush.cse29@...il.com>
To: john-dev@...ts.openwall.com
Subject: Simple Bit slice DES encryption using JTR

Hello Everyone,

I hope my problem is not so big enough that it will take much time for you
people. I just want to know how to do simple Bit slice DES encryption
through Jtr.

According to me what I considered is as follows :-

1.Taking Lm format as it does not have any salt or iteration.

2.Initializing block in the same way as done in DES_bs_crypt_LM()
considering little endianness and initial permutation(Even for testing I am
not changing plain text i.e (KGS!@#$%)

3.The main stuff is of key initialization, Let us consider I am taking 64
bit key or 8 character key as "AAAAAAAA" , now as it is 64 bit key without
parity drop therefore we can't use DES_bs_set_key_LM() so I am using using
DES_bs_set_key() for initialization. Now as we are using LM format we need
to modify some part because of this change.

    The changes that I made are as follows:

         First, In DES_bs_init() Now I am using "k = DES_bs_all.KSp"
instead of "k = DES_bs_all.KS.p" and also commenting some LOC as follows:

           1)              //if (LM) bit = DES_LM_KP[bit];



            2)           /* if (LM) {
                              for (c = 0; c < 0x100; c++)
                       #ifdef BENCH_BUILD
                              if (c >= 'a' && c <= 'z')
                               DES_bs_all.E.u[c] = c & ~0x20;
                                else
                               DES_bs_all.E.u[c] = c;
                       #else
                               DES_bs_all.E.u[c] = CP_up[c];
                      #endif
                         } else{
                              for (index = 0; index < 48; index++)
                              DES_bs_all.Ens[index] =
                                   &DES_bs_all.B[DES_E[index]];
                                  DES_bs_all.salt = 0xffffff;
                     #if DES_bs_mt
                                  DES_bs_set_salt_for_thread(t, 0);
                      #else
                                   DES_bs_set_salt(0);
                     #endif
                       }
                        */

  Now the last change I made in DES_bs_crypt_LM(), Here now I am taking
using DES_bs_finalize_keys() instead of  DES_bs_finalize_keys_LM() and k =
DES_bs_all.KS.v instead of k = DES_bs_all.KS.p

But at last I am getting self test failed using key "AAAAAAAA" and
ciphertest  $LM$63f22fe8518a5691 (Simple DES encryption) .How ever if I use
empty key string and corresponding cipher text i.e $LM$aad3b435b51404ee
then it is working fine, so definitely some problem is in key
initialization only.

Can you please help me what else I missing for key initialization?

Here I also attached patch.

Thanks

Piyush Mittal

Content of type "text/html" skipped

Download attachment "patch.diff" of type "application/octet-stream" (2639 bytes)

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.