question about time attack

Symeonidis Alexandros admin at yourmail.gr
Fri Oct 14 06:32:44 EEST 2005


bori kanis na voithisi ke na mu eksigisi giati o kwdikas:

int password-check( char *inp, char *pwd){
oklen = 1;
if (strlen(inp) != strlen(pwd)) oklen=0;
for( ok=1, i=0; i < strlen(pwd); ++i)
if ( inp[i] != pwd[i] )
ok = ok & 0;
else
ok = ok & 1;
return ok & oklen;
}

den dexete time attack, se antithesi me ton:

int password-check( char *inp, char *pwd) {
if (strlen(inp) != strlen(pwd)) return 0;
for( i=0; i < strlen(pwd); ++i)
if ( inp[i] != pwd[i] )
return 0;
return 1;
}

efxaristw ek ton proterwn





More information about the Linux-greek-users mailing list