Crypto
expanding byte bruteforce program Mar 29 2011 05:46PM
andrewhaynes clear net nz
#include <stdio.h>

#include <stdlib.h>

#include <string.h>

//This is test program to detect if there is a weakness in the shrinking process,

//it brute force values that could generate the bytes in W[t], using W[t] as the base and offsetting

//against itself.block = x+y1; block1 = y+x1; 7/1.57 = 4.45/1.57 = 2.83(4.83,2.45), as

//message block is problem hidden but W might not be

// changing (block + block1 + block + block1)-divy) > (start-0.01) to fit how the 1()

//works

//run this function under the 1() and compare the output to the message_block,

//compare the divy(var) for every W to see if there duplicates

/* 1()

for(t = 0; t < 16; t++)

{

W[t] = context->Message_Block[t * 4] << 24;

W[t] |= context->Message_Block[t * 4 + 1] << 16;

W[t] |= context->Message_Block[t * 4 + 2] << 8;

W[t] |= context->Message_Block[t * 4 + 3];

//printf("%02X ",W[t]);

}

*/

main() {

float x,y,x1,y1;

float block,block1;

// value of bytes in W[t] expanded ,say w[3] = 0x07

unsigned int exp=7; //these two should be the same

float start = 7; //

float temp = 0.00;

float temp1 = 0.00;

float divy = 1.01;

unsigned int i=0,j=0,count=0;

//4.458

for(j=0;divy<start;j++) {

divy = divy + 0.01; //dividing gets incremented to it reaches W[t]

temp = start;

temp1 = start;

temp = temp/divy;

temp1 = temp1/divy;

x1 = ((temp*100));

for(i=0;x1>99;i++) {

x1 = x1 - 100;

}

x1 = x1 / 100; //saves .XX to x1

x = temp1-(x1); //saves XX. to X

temp = temp/divy;

temp1 = temp1/divy;

y1 = ((temp*100));

for(i=0;y1>99;i++) {

y1 = y1 - 100;

}

y1 = y1 /100; //saves .yy to y1

y = temp1-(y1); //saves yy. to y

block = x+y1;

block1 = y+x1;

//if just checks against a value(in this case just balanced,7=7)

if(((block + block1 + block + block1)-divy) > (start-0.01) && ((block + block1 + block + block1)-divy) < (start+0.01)) {

printf("%f divy\n",divy);

printf("expanding\n");

count=0;

for(j=0;exp < 0xfffffff;j++) { //multiples W[t] up to Dword,some check like rotate,or top to bottom in column

exp = exp * divy; //could be used to match message block

printf("%8X\n",exp);

count++;

//if(exp&0xff == message_block[0]) record divy value

}

printf("generated %d\n",count);

exit(1);

}

}

}

[ reply ]


 

Privacy Statement
Copyright 2010, SecurityFocus