Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 03 Jul 2013 20:58:56 +0200
From: marcus.desto <marcus.desto@...pl>
To: john-dev@...ts.openwall.com
Subject: OpenCL PBKDFv2 Kernel With Python

Hello volks,
 
I am prototyping a tool for encryption in python using PBKDFv2 (pdkdfv2-hmac-sha1) and I would like to use OpenCL implementation of PBKDF2 I have found in the source of JTR.
 
This is my first bigger project and I am not very good in c/c++ (yet). So, I ask you for some help.
 
At this time my problem is the result of the opencl pbkdf2. It differes from the PBKDFv2 implementation in python (running slowly on CPU only):
 
Only for displaying purpose:
 
Result Array : [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
Array int of chars password "OpenCL is cool!" : [ 79 112 101 110  67  76  32 105 115  32  99 111 111 108  33]
Array int of chars passwordSalt "12345678901234567890123456789012" : [49 50 51 52 53 54 55 56 57 48 49 50 51 52 53 54 55 56 57 48 49 50 51 52 53
 54 55 56 57 48 49 50]
Array int of chars passwordIterations "253" : 253
Array int of chars keyBytes "15" : 15
 ---
(GPU) PBKDFv2 OpenCL output : [107  80  35 235 171  33 223 171 201 217  82 149 156 252 245]
(GPU) PBKDFv2 OpenCL time   :0.28
(CPU) PBKDFv2 Python output : [69, 96, 85, 6, 171, 191, 91, 111, 61, 247, 9, 212, 88, 79, 93]
(CPU) PBKDFv2 Python time   :0.02
 
My call of your opencl function is the following:
(in python)
prg.PBKDF2(queue, (1,), None, pass_global_buf, salt_buf ,numpy_usrlen, numpy_num_keys, out_global_buf).wait()
Essential are the parameters
pass_global_buf (is type cl_uint)
salt_buf  (is cl_uint)
numpy_usrlen  (is cl_int)
numpy_num_keys (is cl_uint)
out_global_buf &lt;== buffer type is cl_uint
I tried several configurations, like uint8, uchar, uint32 using numpy as suggested by A.Gloeckner from the pyopencl project, but without any positive result. Passing between opencl and python was successful, but as soon as I do some computation using your opencl implementation the values become corrupt.
Declaration of your implementation is:
void PBKDF2 ( const __global unsigned int *pass_global,
              const __global unsigned int *salt,
              int usrlen,
              uint num_keys,
          __global unsigned int *out_global)
 
Would anyone like to help me to solve the problem?
 
Regards,
Marcus
Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.