bkerler / opencl_brute

MD5,SHA1,SHA256,SHA512,HMAC,PBKDF2,SCrypt Bruteforcing tools using OpenCL (GPU, yay!) and Python
MIT License
163 stars 44 forks source link

`pwArray.extend(pw) TypeError: an integer is required #5

Closed LeMoussel closed 5 years ago

LeMoussel commented 5 years ago

Hi, I got this error: pwArray.extend(pw) TypeError: an integer is required in opencl.py. To correct, at line 185 I did this : pwArray.extend(pw.encode('utf-8'))

for example for SHA256 hash

pw = 'TEST'

# In loop
 pwArray.extend([0] * (inBufSize_bytes - pwLen))
=> len(pwArray) = 132
=> pwArray: bytearray(b'\x04\x00\x00\x00TEST\x00\x00\x00\x00\x00.....

# After loop 
 pwArray = np.frombuffer(pwArray, dtype=np.uint32) 
=> len(pwArray) = 33
=> pwArray: [         4 1414743380          0          0          0          0
                                0          0          0          0          0          0
                                0          0          0          0          0          0
                                0          0          0          0          0          0
                                0          0          0          0          0          0
                                0          0          0]
bkerler commented 5 years ago

As it says. you need to convert it to integer, not to ascii or bytes :) See test.py for correct implementation details.