home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] crack vi-x

On Thu, 2010-09-02 at 17:19 -0400, Peter Sjoberg wrote:
> in short: Does anyone know about a crack program for a vi -x encrypted
> file?
> 
I have now done some more research in this area. It seems like no one
really attacked the "crypt" _program_, only the "crypt" library routine
- which is _not_ the same.
JtR goes for the part that passwd uses, des_crypt() or crypt() which is
library routines and they are part of what I'm looking for but not the
biggest(slowest) part.



The source for crypt can be found at
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/crypt/crypt.c

I downloaded it and gprof tells me that the slowest part there is in the
area of line 81-96. Does anyone have a hint on ways to speed up that
part?

        for (i = 0; i < ROTORSZ; i++) {
                seed = 5*seed + buf[i%13];
                random = (int) seed % 65521;
                k = ROTORSZ-1 - i;
                ic = (random&MASK)%(k+1);
                random >>= 8;
                temp = t1[k];
                t1[k] = t1[ic];
                t1[ic] = temp;
                if (t3[k] != 0) continue;
                ic = (random&MASK) % k;
                while (t3[ic] != 0) 
                    ic = (ic+1) % k;
                t3[k] = ic;
                t3[ic] = k;
        }


> Now to my questions 
> - is there really no program already written that does some kind of
> dictionary/brute force attack on a vim-x file?
Still looking for this, problem with google is to separate the _program_
crypt from the _libcall_ crypt + everyone seems to attack the passwd
hash = the libcall, not the program.
Have looked a little at some enigma crackers but they are to different
from the crypt program to be of any help.

New path: Since I'm using this as an excuse to learn some programming I
now made it to the point that I want to create a few threads and then
load them up with psw to check. I started to read about pthread but have
problems with the syncronization. I can't seem to find any example code
where there is a master queue manager thread that feeds a pile of worker
threads.
I was thinking something like

1 pthread_init all threads as idle workers

2 figure out next psw to test

3 verify that system load is < some given max (feel that's better then
setting a thread max=cores+2 or so, please tell me if that's wrong)

4a find a free thread and give the psw to that thread
or
4b put psw in some small work queue and broadcast a "thread wakeup" call
(maybe all threads are idle by waiting for a semaphore and once a psw is
available the semaphore is upped.)

5 repeat from 2 until done

I was expecting to find some code samples for that but the closest I got
so far is someone saying it's in a book that is out of print.

Am I way off in my thinking on how to use threads to keep all cores
busy? Does anyone have some online pointers to thread programming
samples?

/ps



references