A Engine Kernal for Generic Cracking- my entry

From: Douglas Eagleson (eaglesondouglas_at_yahoo.com)
Date: 10/30/05


Date: 30 Oct 2005 09:45:18 -0800

Here is a crack implementation. I hard coded in the DES tesst vectors.
 And it should search the defined space to the limit specified by the
variaable, "limit". It should be about 2.5e4 for the 8 byte block
size.

I have no scientific theory and no actual loop exit yet:( My msdos
machine is an old slow one. A day on the 3Ghz machine should test it.

It can be sized to other block sizes by scaling. And the key is a
machine state type.
*********************start c code****************************

/*The Parity Shuffler Algorithm Applied and called 3desCracker,
by Douglas Eagleson, 2005*/

#include <stdio.h>
#include <stdlib.h>

double counter;
double limit= 2.5e4;
unsigned char block[8];
unsigned char right[8];
unsigned char key[8];
unsigned char keyin[8];
char hello[]= {"Hello-the key is hard coded now."};

int point;

int i,j,k,s;

void main(){

printf(hello);
//set key to all zero to start
for(i=0;i<8;i++){
keyin[i]=0x00;
}

//set input block to input state
//this vector is from the nIST des site.
block[0]=0x80;
block[1]=0x00;
block[2]=0x00;
block[3]=0x00;
block[4]=0x00;
block[5]=0x00;
block[6]=0x00;
block[7]=0x00;

s=1;

while(s){

if(keyin[0]<255){
keyin[0]=keyin[0]+1;
//printf("keyin[0]=%x\n",keyin[0]);
}else{

keyin[0]=0x0;
if(keyin[1]<255){
keyin[1]=keyin[1]+1;
//printf("keyin[1]=%x\n",keyin[1]);
}else{

keyin[1]=0x0;
if(keyin[2]<255){
keyin[2]=keyin[2]+1;
printf("keyin[2]=%x\n",keyin[2]);
}else{

keyin[2]=0x0;
if(keyin[3]<255){
printf("add 1000\n");
printf("keyin[3]=%x\n",keyin[3]);
keyin[3]=keyin[3]+1;

}else{
keyin[3]=0x0;
if(keyin[4]<255){
printf("add 10000\n");
keyin[4]=keyin[4]+1;

}else{
keyin[4]=0x0;
if(keyin[5]<255){
printf("add 100000\n");
keyin[5]=keyin[5]+1;

}else{
keyin[5]=0x0;
if(keyin[6]<255){
printf("add 1000000\n");
keyin[6]=keyin[6]+1;

}else{
keyin[6]=0x0;
if(keyin[7]<255){
printf("add 7\n");
keyin[7]=keyin[7]+1;

}else{
keyin[7]=0x0;
}}}}}}}}//end else nest

for(k=0;k<8;k++){

/*the intitial state key as the third
abstract theoretical state is reused*/

key[0] = keyin[k]&0x1;
key[1] = (keyin[k]>>1)&0x1;
key[2] = (keyin[k]>>2)&0x1;
key[3] = (keyin[k]>>3)&0x1;
key[4] = (keyin[k]>>4)&0x1;
key[5] = (keyin[k]>>5)&0x1;
key[6] = (keyin[k]>>6)&0x1;
key[7] = (keyin[k]>>7)&0x1;

counter=0;

while(counter<limit){
point=0;//reset success tally counter
counter=counter+1.00;

/*save right side bit.*/
for(i=0;i<8;i++){
right[i]=block[i]&0x1;
}

/*shift block right one bit.*/
for(i=0;i<8;i++){
block[i]>>=1;
}

for(i=0;i<8;i++){
right[i]=right[i]^key[i];
}

/*Replace rightside bits onto block.*/
if( (right[7])==0x1){
block[0]=block[0]^0x80;
}
if((right[6])==0x1){
block[7]=block[7]^0x80;
}
if((right[5])==0x1){
block[6]=block[6]^0x80;
}
if((right[4])==0x1){
block[5]=block[5]^0x80;
}
if((right[3])==0x1){
block[4]=block[4]^0x80;
}
if((right[2])==0x1){
block[3]=block[3]^0x80;
}
if((right[1])==0x1){
block[2]=block[2]^0x80;
}
if((right[0])==0x1){
block[1]=block[1]^0x80;
}

/****************************************************/
/***********search to success test***********************/
/***************************************************/
/*Test for correct state*/

        if(block[0]==0x95){
                point=point+1;
        }
        if(block[1]==0xf8){
                point=point+1;
        }
        if(block[2]==0xa5){
                point=point+1;
        }
        if(block[3]==0xe5){
                point=point+1;
        }
        if(block[4]==0xdd){
                point=point+1;
        }
        if(block[5]==0x31){
                point+point+1;
        }
        if(block[6]==0xd9){
                point+point+1;
        }
        if(block[7]==0x00){
                point+point+1;
        }
if(point==8){
s=0;//and exit while loop successfully
counter=limit;
k=8;
}

}//end counter/limit while loop

}//end k for loop

}//end big s while

printf("We have apparently exited the loop due to success");

}//end main



Relevant Pages

  • REPOST: A Engine Kernal for Generic Cracking- my entry
    ... I hard coded in the DES tesst vectors. ... I have no scientific theory and no actual loop exit yet:(My msdos ... unsigned char block; ... printf("We have apparently exited the loop due to success"); ...
    (sci.crypt)
  • Re: need a prog to pause
    ... Here is the never ending loop I was talking about. ... The ReadSLC() calls another function (listed also, ... PCLovl = (unsigned char huge *) NULL; ...
    (comp.os.msdos.misc)
  • Re: Linux 2.6.27.27
    ... is competent with gcc. ... that's very much a compiler bug. ... unsigned char i, ... ... infinite loop, even though it clearly is not. ...
    (Linux-Kernel)
  • RE: GOTO statement and return results way
    ... I kew that about nested ifs, but I don't like it because it adds complexity ... But, risking to be too fussy, this "loop until true" trick seems just a bit ... If Success Then ... If Fail Then Exit Do ...
    (microsoft.public.dotnet.languages.vb)
  • Re: is there a better way to mkdir?
    ... mkdir returns true on success. ... Each time mkdir fails, I chop of ... The outer loop ... Normalizing the path is another issue. ...
    (comp.lang.perl.misc)