Re:Crowdsourcing Bruteforcing: Help me win the EngineYard ch...
by sil3ntmac on Monday July 20, 2009 @05:00PM
(#715186)
Nah, some script kiddie messin with me. Fixed and patching the hole now...
[ Parent
| on HN ]
Re:Crowdsourcing Bruteforcing: Help me win the EngineYard ch...
by barredo on Monday July 20, 2009 @05:01PM
(#715187)
Well, 43 isn't that bad :-)
Re:Crowdsourcing Bruteforcing: Help me win the EngineYard ch...
by sil3ntmac on Monday July 20, 2009 @05:06PM
(#715198)
Haha, he left a message in my database.
"Oh but for your trouble I generated a few hundred thousand hashes for you. --Phil Freo"
Thanks Phil :-) Your message's hash had a hamming distance of 73
Re:Crowdsourcing Bruteforcing: Help me win the EngineYard ch...
by jacquesm on Tuesday July 21, 2009 @02:39AM
(#715833)
a quicker approach to your bit counting routines:
(in C because that's what I'm most comfortable with, but it is pretty much a drop-in replacement for your code)
#include <stdio.h>
char dist[256];
hamm_init()
{
int i,j,n;
for (i=0;i<256;i++) {
j = i;
n = 0;
while (j) {
if (j & 1) {
n++;
}
j >>= 1;
}
dist[i] = n;
}
}
int hamming_distance(char * hash1,char * hash2) {
//calculate the distance between two hashes
int d = 0;
while (*hash1) {
if (*hash2 == 0) {
break;
}
d += dist[*hash1++ ^ *hash2++];
}
return d;
}
main()
{
hamm_init();
printf("0 %d\n",hamming_distance("abcd","abcd"));
printf("1 %d\n",hamming_distance("accd","abcd"));
}