Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 18 Feb 2012 18:48:57 +0100
From: Samuele Giovanni Tonon <samu@...uxasylum.net>
To: john-dev@...ts.openwall.com
Subject: Re: format names for GPU-enabled implementations

On 02/18/12 17:41, Solar Designer wrote:
> On Sat, Feb 18, 2012 at 05:36:23PM +0100, magnum wrote:
>> On 02/18/2012 05:08 PM, Solar Designer wrote:
>>> We'd need to have "john" print something at runtime as well when it
>>> has GPU code in it, is invoked on a GPU-enabled hash type, but
>>> without the proper --format option (so using the CPU only). %-)
>>
>> This is already the case!
>>
>> magnum@...ge:john$ ./john test/test.md5
>> Warning: detected hash type "md5", but the string is also recognized as
>> "cuda-cryptmd5"
>> Use the "--format=cuda-cryptmd5" option to force loading these as that
>> type instead
>> Loaded 4 password hashes with 2 different salts (FreeBSD MD5 [SSE2i 12x])
>> Remaining 2 password hashes with no different salts
> 
> Oh, indeed. :-)  Since this code was put in for a different purpose
> (ambiguous hash encodings), somehow I did not realize it'd do just what
> we need here - but indeed it does.  Thanks!
> 
> OK, let's keep things as they are, then.

also, since opencl formats are registered in john.c
with a define we could add them
before the

cnt = dynamic_Register_formats(&pFmts);

in that way they become the default for that given format .
i don't know if it mess up with cpu formats.

btw i'm a bit unfamiliar with cuda but i think we can't merge them:
cuda is nvidia only therefore on nvidia cards it would compile but
that's not possible on ati .

about documentation there's a Redme.opencl on the doc dir, which is
something i did in the spare time.
unfortunately i'm still a noob with git and pull requeste so i will add
it here for simplicity

Cheers
Samuele

====================
PRELUDE:
====================

You can use OpenCL if your video Card - from now GPU - support it.
Ati/AMD and Nvidia support it through their SDK available at
nvidia and ati/amd website.

N.B. DON'T use X11 opensource drivers provided by your distribution,
either install fglrx or nvidia dkms package or go directly with the
ones provided by nvidia and ati.

This code is still highly experimental, therefore we suggest you
to try at your own risk. 
GPU should not get overheated due to some limitation from the hardware
however keep checking your temperature .

This code has been tested on Linux, any chance it will work as it is
under other Operating System is due to a luck factor :-)

OpenCL patches have been lately introduced to add GPU support to john;
unfortunately, due to opencl design they shine when you have million
of password to test.

OpenCL won't:
- improve your speed if you have dictionary less then 1 000 000 words
- work well in single mode due to using large sets of password
- work with ATI and a remote console unser some certain condition
  (see http://goo.gl/4L8Tt for more information )
- make this world a better place
   

====================
COMPILING:
====================

Ati/AMD suggest you to use ATISTREAMSDKROOT env variable to
provide where you have installed their SDK root. 
nvidia simply install it in /usr/local/nvidia .

Makefile assume you have $ATISTREAMSDKROOT setted up to point
to your ati installation or you have $NVIDIA_CUDA pointing to
nvidia installation.

In in doubt do a 

#updatedb && locate CL/cl.h && locate libOpenCL.so 

to locate your path to the includes and libOpenCL .

Adjust NVIDIA_CUDA or ATISTREAMSDKROOT to your needs and
if something is still wrong (but it shouldn't) send
an email to john-users@...ts.openwall.com for help.



====================
USAGE:
====================

You can use john with your favourite options and the relative
opencl format you need.

BEWARE! single mode doesn't work and won't work due to failing
in allocating memory; i strongly recommend using opencl patch
in wordlist and incremental modes only.

On some opencl formats there are two variables you can adjust:
these are $LWS and $KPC 

LWS is the local work size aka, the number of "threads" the job
will be split and sent to the GPU.

- if $LWS is not setted john will try to get the one 
  best for your system

KPC is the Keys Per Crypt, the number of keys they will be tried
at the same time .
- If you unset KPC, john will use a default Keys per Crypt, which
  at the moment is 1024 * 2048 .
- if KPC is setted to 0 john will try to get the one best for
  you system, BEWARE it will take a couple of minutes
- KPC is highly dependant on you PCI-E bandwith rate which at the
  moment is one of the biggest bottleneck for opencl in john


once you have found the best LWS or KPC for your system you can
do 
export LWS=NUM1
or 
export KPC=NUM2

to avoid testing.

Warning ! LWS and KPC are highly dependant on the format you are
using.
LWS and KPC are not yet in every opencl format john is using.


====================
Optimization:
====================

if you plan on using opencl only for incremental mode (which at
the moment is the one that gives the fastest speed) it could be
a good idea to set up PLAINTEXT_LENGTH to a lower value than
32.


============================================================
Following is the verbatim original content of this file:
============================================================

This distribution of John the Ripper requires OpenCL to compile.

If you don't have OpenCL, download install and configure it before 
proceeeding.

Any bugs, patches, comments or love letters should be sent to
samu@...uxasylum.net or jtr-dev mailing list.

Enjoy.
--
Samuele Giovanni Tonon <samu@...uxasylum.net>

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ