3

I want to use the unix crypt function in an OpenCL program. Does something like that already exist or will I have to translate it on my own?

talonmies
  • 70,661
  • 34
  • 192
  • 269
mae
  • 14,947
  • 8
  • 32
  • 47
  • 1
    How exactly do you want to use it? Do you want an implementation which can run on several inputs in parallel (possible) or do you want to have a routine which is internally parallized (that is you have one input and want to encrypt it faster, much harder to write)? Furthermore what are you trying to use DES cryption for nowadays (since it can't really be considered secure anymore)? – Grizzly Jan 05 '12 at 16:33
  • @Grizzly: I'm actually looking for the same thing (or at least advice on implementing crypt(3) on CUDA and possibly OpenCL. In particular I'm wanting to run many inputs in parallel. It would make no sense to me to try and internally parallelize crypt(3) since crypt runs in CBC mode and output of each pass is dependent on the previous. What I'm trying to use crypt for is generating tripcodes to match substrings using LCS and/or regex. Generating tripcodes relies on the unix crypt(3) hash function. – Trigulus Jan 12 '12 at 06:36
  • 1
    I'm not sure if going anywhere near cryptography with OpenCL/CUDA is a wise move, seeing how CUDA in particular is made for GPUs (and most people use OpenCL with GPUs most of the time too). Haque and Pande 2010 published very noticeable soft error rates on GPUs following an experiment over 50,000 machines on Folding@home. Random bit errors are very acceptable for graphics, but for crypto/authentication, it's BANG YOU'RE DEAD. Also, for parallel execution to be efficient, you would have to batch many hundred requests first, which means you could as well evaluate them in the mean time. – Damon Jan 12 '12 at 10:52
  • @Trigulus: Actually that was my idea as well. I wanted to make a tripcode bruteforcer for GNU/Linux. No matter what Damon says, this thing is very possibly. There is already a bruteforcer that does exacly this on Windows, but it is closed source. They had to implement crypt at some point. – mae Jan 19 '12 at 23:59
  • If you just want a bruteforce. GPU is the way to go, you don't need to pass input to the GPU, and the algorithm will run perfectly in parallel. The only problem is.... how to implement it properly? – DarkZeros Nov 10 '13 at 23:43

2 Answers2

1

You've probably found an answer by now, but in case anyone else comes here from a search, John The Ripper is open source and has OpenCL acceleration for several hashing algorithms, including the 3DES used in BSD crypt().

https://github.com/magnumripper/JohnTheRipper/tree/bleeding-jumbo/src/opencl

dannysauer
  • 3,793
  • 1
  • 23
  • 30
0

You might be interested in this paper I found on AMD's website: http://developer.amd.com/resources/documentation-articles/articles-whitepapers/bulk-encryption-on-gpus/

It covers implementing AES in OpenCL. Your goal with the encryption is important. Since you suggested crypt, I am guessing that you're just playing around. But if you want to actually apply the algorithm, it is important to choose the algorithm based on your goals. There are very important differences private key, public key, and password hashing algorithms.

Kurt
  • 297
  • 2
  • 10