masterzorag's Activity

Monday, September 19, 2011

What (da fuck) I'm doing now?!

bruteforge does words, where store those? I'm writing blackhole.
blackhole is a database engine with import/export capability to/from an sqlite database, the third piece of code does pmk computation via OpenCL (I'm targeting the PS3 on all 7 SPE!), an optional fourth piece will export to a cowpatty table to externally perform the attack.
All is written in C, linking gmp, sqlite, openssl; OpenSSL? Yes, blackhole starts doing pmk hash using the CPU with SSE2, I'm using for my tests the SHA-1 SSE2 implementation (C) 2008 by Alvaro Salmador, (easy, I'm not spreading anything, same code was implemented in pyrit too...)
I've melt that code to get result checking, was a new stuff, as sqlite. Many useful thing to know, as ever.

So what? One single thread export from sqlite db, compute pmk and store back result into sqlite db doing a little more of 500 pmk/s.
Sounds good, now I'm thinking how store the pmk: a uchar[32], or better: 8 uint32, 32byte, let me better explain:
After doing the math the result is 8 uint32, 8*4byte = 32byte, by the way the hash output is obtained by reading as uchar (byte after byte) the same 32byte, so simply I'm thinking to store those 8 uint32 into 8 sqlite coloums, in this way sqlite will stores max 64byte per record using INTEGER type.
The fouth piece will then read computed INTEGER results with atoi(), stores into a 32byte before get written to a cowpatty table.
Why? uchar[32] can be full of NULL and friend... How to store an uchar[32] into sqlite coloumn using BLOB type?
Storing as hexadecimal string will be the same (64byte per record), but every uchar must be hexcoded importing and then hexdecoded while exported...
Storing as binary? New stuff to learn, anyone can point examples?