Hash cracking and Bitcoin mining with the Monster ... - 2600 Thailand

carpentergambrinousSecurity

Dec 3, 2013 (4 years and 29 days ago)

2,000 views

 
 
Hash cracking and Bitcoin
Hash cracking and Bitcoin
mining with the Monster GPUs
mining with the Monster GPUs
By Pattawong Pansodtee
By Pattawong Pansodtee
pattawongse@gmail.com
pattawongse@gmail.com
What is GPU ?

Graphics Processing Unit

Video decoder

3D computer graphics accelerator

General Purpose GPUs (GPGPU)
General Purpose GPUs (GPGPU)

Using GPU (graphics processing unit) and CPU
to accelerate general-purpose scientific and
engineering applications
Sparse Linear Algebra
Spectral Methods
GPU Ref vs Non-Ref

Reference Card – Standard Card from
manufacture (AMD,Nvidia)

Non-Reference Card – Design by other
manufacture (Asus,Gigabyte,EVGA,…) but
using same gpu chip
Reference Card(AMD)
AMD Radeon HD 7970
http://images.anandtech.com/doci/5319/his_7970.jpg
http://www.tech2date.com/wp-content/uploads/2012/01/AMD-Radeon-HD-7970.jpg
Reference Card(Nvidia)
Nvidia Geforce GTX 680
http://images.bit-tech.net/content_images/2012/03
/nvidia-geforce-gtx-680-2gb-review/gtx680-17b.jpg
http://www.vmodtech.com/main/wp-
content/uploads/2012/03/29/asus-gtx-680/asus-gtx-680-
graphics-card01.jpg
Non-Reference Card(AMD)
http://images.anandtech.com/doci/5706/gigabyte_7870.jpg
http://flyingsuicide.net/wp-content/uploads/2012/01/asus-radeon-hd-7970-directcu-ii-1.jpg
AMD Radeon HD 7970
Non-Reference Card(Nvidia)
http://rog.asus.com/wp-content/uploads/2012/11/ASUS-GTX-680-4GB-DCII-angle.jpg
http://www.overclockers.ru/images/lab/2012/05/17/1/09_1_big.jpg
Nvidia Geforce GTX 680
CPU vs GPU

CPU

Good at make decisions, executive,Serial
Processing

Less Core At High Clock Speed

GPU

Good at video processing,Math, parallel work

Large amount Core At Low Clock Speed
CPU vs GPU

Example typical CPU can crack WPA using
aircrack-ng at speed around 2,000-4,000 key/s

But for typical GPU can crack WPA

at speed around 50k-120k key/s
AMD vs Nvidia

AMD(Open CL)

Many simple ALUs/shaders run at low
frequency clock(typically 1120-3200 ALUs at
625-900 MHz)

Nvidia(CUDA,OpenCL)

A few are more complex ALUs run at higher
shader clock  (typically 448-1024 ALUs at
1150-1544 MHz)
AMD vs Nvidia

AMD Radeon HD 6990

3072 ALUs x 830 MHz = 2,550 billion 32-bit
instruction per second

Nvidia Geforce GTX 590

1024

ALUs x 1214 MHz = 1243 billion 32-bit
instruction per second

Approximate 
2x-3x
 performance difference
AMD vs Nvidia

In some algorithm like SHA-256 which makes
heavy use of the 32-bit integer right rotate
operation

For AMD can be done in single hardware
instruction 

For Nvidia requires three separate hardware
instructions
AMD vs Nvidia

Combined 2 Factor in ALUs-Clock Speed and
Hardware instructions make AMD overall 3x-
5x faster than Nvidia
GPU Chart(AMD)
GPU Name
Single MD5 speed
Single SHA1 speed
WPA speed
Price
SHA1 perf. per $
ATI Radeon HD 5XXX Series
Radeon HD 5830
3306M
896M
52071
$170
5.27
Radeon HD 5850
3852M
1044M
60672
$220
4.75
Radeon HD 5870
5018M
1360M
79036
$270
5.04
Radeon HD 5970
8561M
2320M
134826
$600
3.87
ATI Radeon HD 6XXX Series
Radeon HD 6850
2745M
744M
43237
$175
4.25
Radeon HD 6870
3720M
1008M
58579
$210
4.8
Radeon HD 6930
3887M
1000M
58115
$180
5.56
Radeon HD 6950
4560M
1173M
68188
$245
4.79
Radeon HD 6970
5472M
1408M
81825
$360
3.91
Radeon HD 6990
10323M
2656M
154352
$700
3.79
AMD Radeon HD 7XXX Series
Radeon HD 7750
1658M
427M
24796
$109
3.91
Radeon HD 7770
2591M
667M
38743
$159
4.19
Radeon HD 7850
3565M
917M
53310
$249
3.68
Radeon HD 7870
5182M
1333M
77486
$349
3.82
Radeon HD 7950
5804M
1493M
86784
$449
3.33
Radeon HD 7970
7670M
1973M
114679
$549
3.59
GPU Chart(Nvidia)
GPU Name
Single MD5 speed
Single SHA1 speed
WPA speed
Price
SHA1 perf. per $
Geforce GTX 6XX
GeForce GT640
485M
115M
6686
$99
1.16
GeForce GTX660
1321M
313M
18200
$230
1.36
GeForce GTX660 Ti
1727M
409M
23791
$300
1.36
GeForce GTX670
1727M
409M
23791
$399
1.03
GeForce GTX680
2170M
514M
29893
$499
1.03
GeForce GTX690
3948M
936M
54378
$999
0.94
Tesla
Tesla K10
3214M
762M
44275
-
-
Tesla M2050|C2050
1392M
437M
25373
$2600
0.17
Tesla M2070
1392M
437M
25373
$4200
0.1
Tesla S2050
5570M
1746M
101494
$14000
0.12
Tesla C1060
759M
229M
13332
$1300
0.18
Tesla S1070 400
3027M
915M
53165
$8000
0.11
Tesla S1070 500
3364M
1016M
59072
$9000
0.11
Popular Hash cracking Application
OclHashcat-lite,OclHashcat-Plus (Freeware)
Support most of Algorithm on both AMD,Nvidia GPU, Support GPU Clustering
http://hashcat.net/
Hash cracking Application
hashkill (Open Source)
Support most of Algorithm on both AMD,Nvidia GPU
www.gat3way.eu/hashkill
How does Cracking Speed tell us
This Table based on
AMD Radeon HD 7970 Reference Card
MD5 Speed : 7670M Keys/s (M = 10^6)

Case
keyspace
Time(Hr)
lower case length 8
208827064576.00
0.0075629098
lower case length 9
5429503678976.00
0.196635654
lower case length 10
141167095653376.00
5.1125270047
numberic case length 8
100000000.00
0.00000362161
numberic case length 9
1000000000.00
0.0000362161
numberic case length 10
10000000000.00
0.0003621614
lower + number case length 8
2821109907456.00
0.1021697055
lower + number case length 9
101559956668416.00
3.6781093969
lower + number case length 10
3656158440062980.00
132.41193829
How does Cracking Speed tell us
This Table based on
AMD Radeon HD 7970 Reference Card
WPA Speed : 114,679 Keys/s

Case
keyspace
Time(Hr)
lower len 8
208827064576.00
505.8251112913
lower len 9
5429503678976.00
13151.4528935744
lower len 10
141167095653376.00
341937.775232935
numberic len 8
100000000.00
0.2422220091
numberic len 9
1000000000.00
2.4222200907
numberic len 10
10000000000.00
24.2222009067
lower + number len 8
2821109907456.00
6833.349095824
lower + number len 9
101559956668416.00
246000.567449664
lower + number len 10
3656158440062980.00
8856020.4281879
Wordlist, Precomputation is it work ?
For Fast Algorithm not,Why
Typical for example all password length is 8 letter
1 password = 8 * 1 byte(ASCII) = 8 bytes
AMD Radeon HD 7970 Reference Card
MD5 Speed : 7670M Keys/s (M = 10^6)

That mean we need to read 7670*10^6 * 8 byte /s

= 57.1459532 GB/s from harddrive
Typical Harddrive has read speed 100-120 MB/s
Even SSD has read speed 400-500 MB/s

Salt vs without Salt
For Example we has 10 hash
In case of hash without salt : GPU just calculate hash for single time then
compare with every hash in list
In case of hash with salt : GPU have too re-calculate every single hash
For 10 hash ,hash with salt require more 10 times compare to hash
without salt
Bitcoin Story
Bitcoin (code: BTC) is a cryptocurrency where creation and transfer is based
on an open source cryptographic protocol independent of any central authority.
The concept was introduced in a 2008 paper by pseudonymous developer
Satoshi Nakamoto, who called it a peer-to-peer, electronic cash system
Bitcoin is accepted in trade by merchants and individuals in many parts
of the world.Like other currencies
Bitcoin has limit of 21 million Bitcoins
For sending or receiving Bitcoin done by Bitcoin address(Bitcoin Wallet)
One user can have more than one Bitcoin addresses

Who is Satoshi Nakamoto
Investigations into the real identity of Satoshi Nakamoto have
been attempted by The New Yorker and Fast Company
The patent application (#20100042841) by Neal King,
Vladimir Oksman and Charles Bry on 15 August 2008 contained
networking and encryption technologies similar to Bitcoin's and
textual analysis revealed that the phrase "...computationally
impractical to reverse" appeared in both the patent application
and Bitcoin's whitepaper
Who is Satoshi Nakamoto

All three inventors explicitly denied being Satoshi Nakamoto
Ted Nelson(American sociologist, philosopher, and pioneer of
information technology) speculated that Japanese
mathematician Shinichi Mochizuki is Satoshi Nakamoto
More at
http://qz.com/86255/the-mysterious-creator-of-Bitcoin-could-
be-japanese-mathematician-shinichi-mochizuki-says-the-
inventor-of-hypertext/
Where we can spend Bitcoin
https://www.Bitcoinstore.com/
After Bitcoin become more popular than store receiving Bitcoin
Bitcoin Mining
A Bitcoin is defined by a chain of digitally-signed
transactions that began with its creation as a block reward
through Bitcoin mining. Each owner transfers Bitcoins to
the next by digitally signing them over to the next owner in
a Bitcoin transaction. A payee can then verify each
previous transaction to verify the chain of ownership.
If you can solve next block you get Bitcoin
Solo Vs Pool
Solo : miner performs the mining operations alone All mined blocks are generated to
the miner's credit.
Pros : doesn't incur any fees, higher uptime
Cons : tends to generate more erratic income.
Pool : all of the resources of the clients in that pool to generate the solution to a
given block. When the pool solves a block, the 25 BTC generated by that block's
solution is split and distributed between the pools participants.
Pros : generates a steadier income.
Cons : tends to generate a smaller income due to fees being charged and transaction
fees not being cashed out.
Bitcoin Mining Performance
As in Hash Cracking Bitcoin blockchaing use algorithm base
on SHA-256
So AMD still get 3x-5x more performance over Nvidia
Performance in Bitcoin mining show as hash/s
https://en.bitcoin.it/wiki/Mining_hardware_comparison
Example
AMD Radeon HD 7970 Reference Card : 600 Ghash/s

Profit Calculation
Example
AMD Radeon HD 7970 Reference Card : 600 Mhash/s
Electricity cost typical 4 baht/unit(Kwatt.) = 0.13 US
PC Build with two AMD Radeon HD 7970 Reference Card
Consume around 700W
Profit Calculation
ASIC , FPGA
An ASIC (application-specific integrated circuit) is a microchip designed for a
special application, such as a particular kind of transmission protocol or Bitcoin
mining
FPGA(Field Programmable Gate Arrays) are semiconductor devices that are
based around a matrix of configurable logic blocks (CLBs) connected via
programmable interconnects. FPGAs can be reprogrammed to desired
application or functionality requirements after manufacturing
http://www.epson.jp/device/semicon_e/product/asic/img/ind_01.gif
http://www.adafruit.com/adablog/wp-content/uploads/2011/09/de0nano_LRG.jpg
ASIC , FPGA in Bitcoin mining
5 GH/s Bitcoin Miner
BitForce 5 GH/s SC
Model: BF0005G
$274.00
Terasic DE2-115
Development Board
50 MH/s
Price:
$595
ASIC , FPGA in Bitcoin mining
50 GH/s Bitcoin Miner
BitForce 50 GH/s Miner
$2,499.00
500 GH/s Bitcoin Miner
BitForce 500 GH/s Mini Rig SC
$22,484.00
Real World Scenario
CORE i3 3220 3.30GHz (1155)
3650
1
3650
ASUS MAXIMUS V EXTREME 
14500
1
14500
G.SKILL DDR3 8SR/1866 (4GBX2) CL 9-10-9-28 (SNIPER)
2450
1
2450
GIGABYTE 7970 3G D5 OC
13500
4
54000
ThermalTake Toughpower 1500W
12000
1
12000
G.SKILL PHOENIX III 120GB FM-25S3-120GBP3 R550/W510
4100
1
4100
WD Black 1 Tb
3150
1
3150
NZXT Switch 810
4990
1
4990
98840
Build Specification
Real World Scenario
http://images17.newegg.com/is/image/newegg/19-116-775-TS
Intel CORE i3 3220
ASUS MAXIMUS V EXTREME 
http://images.bit-tech.net/content_images/2012/06/computex-
diary-day-1-2/extreme1b.jpg
Real World Scenario
http://upic.me/i/36/spd_20120110214351_b.jpg
G.SKILL DDR3 8SR/1866

(4GBX2) (SNIPER)
http://www.guru3d.com/miraserver/images/2012/gbt-7970/IMG_5797.jpg
GIGABYTE 7970 OC
Real World Scenario
http://img.tarad.com/shop/h/hardwareservice/img-lib/spd_20120317225354_b.jpg
ThermalTake Toughpower 1500W
http://electronicmartindia.com/ebay/images/gskph3120.jpg
G.SKILL PHOENIX III 120GB
Real World Scenario
http://www.nitroav.com/store/images/P/1TBWDBlackWD1002FAEX_Angle_Large.jpg
ThermalTake Toughpower 1500W
http://cdn.overclock.net/e/ee/eea7e8da_70-nzxt-switch-810.jpeg
NZXT Switch 810
Building
Building
#1 Issue Too Hot Temperature
http://www.hardwareheaven.com/reviewimages/sapphire-radeon-7970-quad/radeon-7970-quad.jpg
Note: not from this build
http://www.evga.com/articles/00517/images/4way_soldout.jpg
#1 Issue Too Hot Temperature
http://i00.i.aliimg.com/wsphoto/v0/608126674/1PC-NEW-font-b-PCIe-b-font-
Express-x16-font-b-Riser-b-font-font-b.jpg
solve by
1.using Pci-E Riser Cable with Extend GPU Stand
2.UnderClock GPU #2 Hottest Temperature around 95-97 C
#1 Issue Too Hot Temperature
alternative way : Liquid Cooling System
http://hardforum.com/showthread.php?t=1751610
#2 Issue Dead GPU,Boot failed

Solve by using new Pci-E riser with Power
Left(new one) Right(old one)
Tunning Peformance

Before Tunning Algorithm: single md5
Speed.GPU.#*...: 24500 M/s

Normally oclhashcat set GPU running at 60-70%

maintain Heat from gpu

but we can get gpu to work 100% by adding
  “
-n 800 --gpu-loops 1024” parameter to oclhashcat
Issue is GPU getting too hot GPU#2 is at 95-97 C
Note* : normal GPU warning is above 90 C
Tunning Peformance

First All GPU running at 1,000MHz except GPU running at 800
MHz

HWMon.GPU.#1...: 99% Util, 64c Temp, 84% Fan
HWMon.GPU.#2...: 99% Util, 90c Temp, 100% Fan
HWMon.GPU.#3...: 99% Util, 63c Temp, 82% Fan
HWMon.GPU.#4...: 99% Util, 78c Temp, 100% Fan

See that GPU #1,#3,#4 Still have capability to overclock

But we also don’t want GPU #2 to running at too hot temperature
Tunning Peformance

So reconfig All GPU Clock speed to

1125 MHz,700 MHz,1125 MHz,1075 MHz

HWMon.GPU.#1...: 99% Util, 68c Temp, 80% Fan
HWMon.GPU.#2...: 99% Util, 87c Temp, 100% Fan
HWMon.GPU.#3...: 99% Util, 70c Temp, 86% Fan
HWMon.GPU.#4...: 99% Util, 82c Temp, 100% Fan

See that GPU #1,#3,#4 work at higher temperature

but GPU #2 got lower temperature :D
Tunning Peformance

Conclusion after Tunning GPU#2 got lower
Temperature but overall performance
increase by 30%

Algorithm: single md5
Speed.GPU.#*...: 34488.8M/s
END

With great power comes
with great electricity bill”