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.01k stars 2.07k forks source link

FPGA for Bcrypt #5230

Closed redkit75 closed 1 year ago

redkit75 commented 1 year ago

Hi, don't you think a new FPGA support is needed for JTR? Besides a very old FPGA card that doesn't even show up on Google, no other FPGA is supported. Do you have any recommendations for breaking fast bcrypt hashes? RTX 4090? Thank you.

ukasz commented 1 year ago

This very old FPGA board was quite good to be honest (ztex 1.15y). Recently I was looking at some decent FPGA target for JTR and couldn't find anything interesting. One thing that I considered was RHS Research Xilinx Artix-7 FPGA M.2 available for $150 on amazon, it is not faster than old ztex board, but more convenient to use. There is also a way of repurposing some FPGA crypto miners, since we have similar application. Regarding current state of the efficient bcrypt cracking I am not up to date, so I can't help on that.

solardiz commented 1 year ago

Sure we have a problem here. ZTEX 1.15y was unique at the time due to people selling their former Bitcoin mining rigs that used this board. This temporarily resulted in great performance for the money, until the boards mostly disappeared from the market. I'm not aware of anything obviously at least as good appearing since, and even if it did it'd take plenty of effort for us to support another board, which we'd probably only do given some really good reason to - or if someone new contributes that.

Meanwhile, the larger community is making good progress at open source FPGA toolchains, including for Kintex 7. Here's a recent tweet that caught my attention: https://twitter.com/hansfbaier/status/1605013103288242178

Hans Baier @hansfbaier@fosstodon.org
@hansfbaier
First time booting #Linux on the $99 QMTech Kintex XC7K325T board with DDR3 memory on the high performance banks.
Bitstream built with full #opensource toolchain https://github.com/kintex-chatter

$99 for XC7K325T sounds pretty good. With lots of luck (and better than default power adapter and cooling), I guess that board would be roughly same speed as the ZTEX 1.15y (about twice fewer LUTs than we had across 4 FPGAs, but more advanced and capable of higher clock rates).

I think here it is:

https://github.com/ChinaQMTECH/QMTECH_XC7K325T_CORE_BOARD https://www.aliexpress.com/item/1005003668804223.html

Edit: Obviously (to me, but maybe not to everyone reading this later) the above board is NOT currently supported in JtR, and would require LOTS of effort to add support for. I am just adding this note to ensure no one buys this based on reading my original comment and expects it to work with JtR - it definitely will not, absolutely no chance at all! The "luck" I referred to above is for a potential development effort to get it supported.

Other not-too-unreasonable options we discussed before are the much larger and much pricier ex-mining boards, and similar boards in AWS (the F1 instances) - but no one got around to supporting them yet, and the ex-mining boards may have already disappeared from the market again.

Do you have any recommendations for breaking fast bcrypt hashes? RTX 4090?

We still recommend ZTEX 1.15y if you can find them... and if not, then yes recent NVIDIA GPUs are getting close, but are pricey, and for bcrypt you'd currently get better speeds on them when using hashcat rather than JtR.

solardiz commented 1 year ago

$99 for XC7K325T sounds pretty good.

In fact, I think that's way below what the chip alone is priced at by Xilinx/AMD when it's new. So this company is probably (re)using old stock or reballed or (unlikely) counterfeit chips available from other sellers. That might not last long.

redkit75 commented 1 year ago

Sure we have a problem here. ZTEX 1.15y was unique at the time due to people selling their former Bitcoin mining rigs that used this board. This temporarily resulted in great performance for the money, until the boards mostly disappeared from the market. I'm not aware of anything obviously at least as good appearing since, and even if it did it'd take plenty of effort for us to support another board, which we'd probably only do given some really good reason to - or if someone new contributes that.

Meanwhile, the larger community is making good progress at open source FPGA toolchains, including for Kintex 7. Here's a recent tweet that caught my attention: https://twitter.com/hansfbaier/status/1605013103288242178

Hans Baier @hansfbaier@fosstodon.org
@hansfbaier
First time booting #Linux on the $99 QMTech Kintex XC7K325T board with DDR3 memory on the high performance banks.
Bitstream built with full #opensource toolchain https://github.com/kintex-chatter

$99 for XC7K325T sounds pretty good. With lots of luck (and better than default power adapter and cooling), I guess that board would be roughly same speed as the ZTEX 1.15y (about twice fewer LUTs than we had across 4 FPGAs, but more advanced and capable of higher clock rates).

I think here it is:

https://github.com/ChinaQMTECH/QMTECH_XC7K325T_CORE_BOARD https://www.aliexpress.com/item/1005003668804223.html

Edit: Obviously (to me, but maybe not to everyone reading this later) the above board is NOT currently supported in JtR, and would require LOTS of effort to add support for. I am just adding this note to ensure no one buys this based on reading my original comment and expects it to work with JtR - it definitely will not, absolutely no chance at all! The "luck" I referred to above is for a potential development effort to get it supported.

Other not-too-unreasonable options we discussed before are the much larger and much pricier ex-mining boards, and similar boards in AWS (the F1 instances) - but no one got around to supporting them yet, and the ex-mining boards may have already disappeared from the market again.

Do you have any recommendations for breaking fast bcrypt hashes? RTX 4090?

We still recommend ZTEX 1.15y if you can find them... and if not, then yes recent NVIDIA GPUs are getting close, but are pricey, and for bcrypt you'd currently get better speeds on them when using hashcat rather than JtR.

Eyes are searching for Apingis :)

ZTEX 1.15y no longer appears even on Google. The latest topics on Bitcointalk are from 10 years ago. Making a specific development for Amazon F1 is currently more intelligent than all.

With my small research, I reached the following benchmark for bcrypt; Work factor 05

Hashes per second 1 Ztex 1.15y board = 120k 1 RXT 4090 = 180k

When we look at the results, the zero price of both products is equal to each other. If there were Ztex boards in the market, we could have gotten the same results 10 times more economically with RTX 4090.

solardiz commented 1 year ago

Hashes per second 1 Ztex 1.15y board = 120k 1 RXT 4090 = 180k

This is about right.

When we look at the results, the zero price of both products is equal to each other. If there were Ztex boards in the market, we could have gotten the same results 10 times more economically with RTX 4090.

I don't get what you mean here. IIRC, the initial price of ZTEX 1.15y was 999 EUR + VAT (back when the boards were still good for Bitcoin mining) and RTX 4090's MSRP is US $1600 - these would make them deliver similar bcrypt speeds per dollar, if you disregard they're 10 years apart. Actual ZTEX 1.15y prices when we considered those used boards for JtR were down to the range of $50 to 250 EUR. A large batch was sold for $100 per board. That would make them ~10x more economic at bcrypt than RTX 4090, so maybe that's what you mean.

Anyway, I'll close this issue now as it's not something we need to track. Please feel free to add more comments anyway.

solardiz commented 1 year ago

the $99 QMTech Kintex XC7K325T board

It is unclear to me whether this board is able to deliver sufficient power to the FPGA to run it at full utilization.

Another issue with the board is it does not readily have a way to interface it with a host computer/cluster. There's a daughterboard providing some connectors, but it too does not provide e.g. USB. So something would need to be invented, either with additional circuitry or implementing a serial protocol in FPGA logic.