openwall / john

John the Ripper jumbo - advanced offline password cracker, which supports hundreds of hash and cipher types, and runs on many operating systems, CPUs, GPUs, and even some FPGAs
https://www.openwall.com/john/
Other
10.36k stars 2.11k forks source link

Add Argon2 support to Keepass formats #5552

Closed magnumripper closed 2 weeks ago

magnumripper commented 3 weeks ago

I've had a branch with Keepass formats supporting Argon2d and Argon2id since almost a year ago. Right before I made a PR, Alain introduced his argon2-opencl format, clashing with my branch. I need to pick up from where I stalled.

The stuff I had worked fine but was awfully slow on GPU (barely usable) so hopefully I can use some of Alain's GPU code for Keepass too. I need to grok it though, and it doesn't look particularly trivial.

At the very least I should rename clashing files and simply let the argon2 code versions live side by side.

solardiz commented 3 weeks ago

I've had a branch with Keepass formats supporting Argon2d and Argon2id since almost a year ago.

It sounds like you had this for both CPU and OpenCL? If you also had it for CPU, it implies you had updated us to newer Argon2 upstream code to have 2id support, right? If so, you could submit that first as a separate PR, as we have an open issue for that and it's needed on its own, regardless of Keepass.

magnumripper commented 3 weeks ago

it implies you had updated us to newer Argon2 upstream code to have 2id support

Right, I updated code from upstream as a separate commit and made whatever changes were needed in the calling formats. Then Alain made changes to the Argon2 files (our older ones). The commit descriptions only ever mention GPU and there are not exactly any comments explaining what the CPU code changes were for. Some of them seem to be about Argon2id BTW. Also, I see now at a quick glance there seem to be OpenCL support code added to the CPU files, such as opencl_argon2_initialize() in argon2_core_plug.c. Perhaps that was all it was about. I'm sure it will clear up once I take a new stab at it.

magnumripper commented 3 weeks ago

Turns out this is easy as pie. Alain's changes to the Argon2 reference code isn't needed at all so I could just drop them. The OpenCL format can call pristine Argon2 functions. I'll sort it out and make a PR or two.

magnumripper commented 3 weeks ago

Closing this in favour of #5097