6
\$\begingroup\$

I'm interested in creating a custom linux based solution that will crunch sha256 cryptographic algorithms at insane levels of speed. I'm also on a limited budget... I have no background in EE but I do w/ Software. My question is custom ASICs have to be designed by some big company w/ some crazy fab process and takes a while. Anything out there that has the low power consumption and high speed processing of an ASIC? I read about SoCs and what looks to be hybrid type chips... i.e. - Zynq-7000 and this Parallella makes use of the same board/chip I believe.

Wondering if I can build something to produce tens of thousands of hashes per second. Even if I need to cluster them (at decent power and price constraints)

Thanks for any help. Currently reading research papers about ICs and everything, just don't understand how something economical yet powerful doesn't exist.

\$\endgroup\$
  • 5
    \$\begingroup\$ This is for bitcoin mining, isn't it? \$\endgroup\$ – pjc50 May 23 '13 at 8:38
  • 1
    \$\begingroup\$ For "insane levels of speed" you should forget using general purpose operating systems. Even a cut-down kernel is going to produce a far far slower solution than the sort of hardware-based solutions typically used (e.g. in devices like routers with hardware crypto support for VPNs etc) \$\endgroup\$ – RedGrittyBrick May 23 '13 at 9:21
  • \$\begingroup\$ the atlys board can get ~3.5 mhashes/s, but for bitcoin mining at the current difficulty would take ~4 months to pay for the $500 board excluding power usage, mining 24h/day. I looked into it briefly and decided it wasn't worth the effort. \$\endgroup\$ – stanri May 23 '13 at 13:04
  • \$\begingroup\$ For such an operation, energy efficiency is important. The best you can achieve is with a high efficiency algorithm implemented on a high efficiency ASIC. HE ASIC would need clock gating, operand isolation and ideally would be operated in a low-speed, sub-threshold regime. To achieve tens of thousands of hashes per second you would need to massively parrallelize the operation. For FPGA implementation, the objective is the same. \$\endgroup\$ – travisbartley Jun 13 '13 at 5:36
  • \$\begingroup\$ I supposed it could be for bitcoin mining - or it could be for password cracking ;) \$\endgroup\$ – bbqchickenrobot Jun 13 '13 at 9:24
14
\$\begingroup\$

If your budget is less then 10-20 thousand dollars (or more realistically 100K+), you have no hope of getting an ASIC made.

The common device used instead of an ASIC, in situations where you cannot afford the NRE (non-returnable expenses - basically the cost for producing the masks for etching your asic, as well as the design costs), is to use a FPGA.

There is a list of papers related to using FPGAs for hash-cracking here.

A lot depends on what you mean when you say your budget is "limited". Big FPGAs can be several hundred dollars a piece, and that's just for the IC (integrated circuit)! The great majority of FPGA-based hash crackers that have been built by amateurs are done by reverse-engineering existing products from e-bay that use FPGAs, commonly real-time video encoding/processing devices.

Really, if you're serious about this project, you should spend some time researching and understanding HDLs. FPGAs (as well as ASICs) are not "programmed" in C, or any other common language you may be familliar with. Instead, they use a language (called a 'Hardware description language") that describes a series of logic operations and registers, that all operate in parallel. It's quite different then C.

Then, you should purchase an inexpensive FPGA development board (digilent makes some nice ones), and get your hashing algorithm working and tuned. Then you could look at scaling up.

It's worth noting that none of this would run linux at all. Everything ASICs do (as well as FPGAs) is so-called "bare metal" the way a ASIC/FPGA works is fundamentally different then a microcontroller, and there is no such thing as a FPGA "operating system". The extent to which linux (or any operating system) is likely to be involved is simply communicating with the special-purpose hardware and feeding it things to hash/reading back hashing hits. This would probably occur over USB, or if you're using a platform like the Zynq, through shared memory.


It's interesting that you mention the parallela people, as that's a pretty good example of the costs involved in doing a fairly complex ASIC. They needed about ~$750,000 to get their design produced as hardware.

\$\endgroup\$
  • 1
    \$\begingroup\$ ...there is no such thing as a FPGA "operating system" - au contraire (not that this would in any way be reasonable for the proposed project) \$\endgroup\$ – Chris Gregg May 23 '13 at 12:14
  • \$\begingroup\$ I love that you have one sentence saying and get your hashing algorithm working and tuned. Don't underestimate how much work it takes to create an optimized implementation for an algorithm like SHA-256. \$\endgroup\$ – orlp May 23 '13 at 13:15
  • \$\begingroup\$ @ChrisGregg - That's not Linux on a FPGA. That is linux on a soft-core CPU on a FPGA. I certainly wouldn't argue that you can run a soft-core CPU on a FPGA, but at that point, you just have a really expensive CPU, not a FPGA. \$\endgroup\$ – Connor Wolf May 23 '13 at 20:59
4
\$\begingroup\$

Why not look for a generally available existing crypto IC that does what you want?

Example

family of secure authentication ICs using the SHA-256 hash algorithm with a 256-bit key length

There are development kits. Sparkfun produce a breakout for it. It communicates using I2C or 1-wire.

(caveat - I've no idea if this particular chip can be used in the way you want)


If bitcoin-mining is the objective, for $1299 75bc you can buy an ASIC-based bitcoin miner. As in all gold-rushes, the shovel sellers prosper more than 99% of the guys desperately scrabbling knee-deep in mud.

\$\endgroup\$
  • \$\begingroup\$ $1299 is the first batch which is sold and long gone. It now is 75 bit coins which is $10000 \$\endgroup\$ – Developer Android May 23 '13 at 12:01
  • \$\begingroup\$ +1 for selling shovels being the real way to make money. \$\endgroup\$ – Dan Neely May 23 '13 at 14:53
  • \$\begingroup\$ I know about the Asic Chips from Avalon.... and BFL. But essentially was looking at obtaining my own for fun. Looking into those development kits, looks interesting. \$\endgroup\$ – bbqchickenrobot Jun 13 '13 at 9:26
3
\$\begingroup\$

FPGAs are definitely the way to go here. I have an Atlys board ($349, $199 for students) that I use for my personal development and it's definitely suits my needs at the moment. There is even open source hashing firmware for bitmining that you might be able to hack or use as a starting point for your own firmware.

Using an atlys, you can get about 3.2 MH/s, this might work for your application. If this is for bitcoin mining, this calculator indicates you'll make 0.0001 BTC in 24 hours at the current difficulty. I looked into it a while back and it's just not worth it unless you have a much beefier board, like perhaps one with a virtex 5 FPGA on it, especially if you're a student ($995, $445 for students).

Just to note, FPGA firmware coding and normal procedural coding are worlds apart. Even if you write code in verilog, which is similar syntactically to c, you are essentially describing the hardware rather that giving a processor a list of instructions.

\$\endgroup\$
  • \$\begingroup\$ How much can the virtex 5 device get? \$\endgroup\$ – bbqchickenrobot May 24 '13 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.