Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 04 Jul 2013 08:23:08 +0200
From: marcus.desto <>
Subject: Re: OpenCL PBKDFv2 Kernel
	 With Python

Hello Michael,
thank you for reply.
Dnia 4 lipca 2013 6:46 Michael Samuel &lt;; napisał(a):
Hi Marcus,
You probably don't want the OpenCL unless you're doing many at once -
for a single password you'd be better off using a plain C version and
using Cython to create a python module.
For some example pyOpenCL code, look at
- the basic concept is that you create a numpy.array with the correct
dtype (numpy.uint32 = OpenCL uint, numpy.int32 = OpenCL int), then
allocate a cl.Buffer(... hostbuf=myarray) which will copy it to the
Of course, OpenCL has massive compile and launch overhead, so if
you're doing this for anything other than cracking passwords, you
probably want to go down the Cython path. Check out
Hope that helps,
In the begining, I just want to simply use OpenCL. I know about the big overhead. You can even see it's effect in the output timings (my first mail). In fact, as you said, it does not make any sense for a single (big) operation, but in case it can be computed by dividing it into few jobs, it does make sense. Anyway, later, when my program runs using OpenCL I want to expand my implementation to encrypt a lot of passwords at the same time - that is why I am about to use OpenCL. Maybe later I will switch to C or C++ and opencl, but first I would like to create a running first version of my program.
Accourding to the python implementation (pyOpenCL), well, thank you for the examples. I actually stack to the steps given by A. Gloeckner in his documentation of pyopencl.
But after I ran the pbkdf2 opencl kernel I found in JtR using pyopencl I was not sure about being wrong in my python implementation, so I started to tryout the casts to convert data from python to the correct one needed in opencl. So, you confirmed that I was not wrong in the very first approaches. It seems like there is something wrong about the pbkdf2 opencl kernel, which is not generic, but tailored to mscash2. That might be the problem resulting different hashes.

Powered by blists - more mailing lists

Your e-mail address:

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