Skip to content

Latest commit

 

History

History
99 lines (52 loc) · 4.45 KB

README.md

File metadata and controls

99 lines (52 loc) · 4.45 KB

SHA3-224 DSS Implementation with Chain-Hashing

Quick implementation playing around with SHA3-224 (using BouncyCastle) hashes and digital signatures. Also does a little bit of chain hashing mimicing blockchain hashes.

Comes with 3 classes:

  1. BlockchainDSS.java

Main program. Makes the calls to the DSS and blockchain transaction modules.

  1. DSSmodule.java

Implements DSS for generating signatures and verifying signatures. SHA3-224 hash used as hashing function.

  1. TransactionModule.java

Creates transactions based on blockchain concepts (chain hashing). Creates a pre-image for the SHA3 hash of 24 leading 0 bits for proof of work.

Contains some eclipse generated files

Read README.pdf for a more detailed explanation.

Warning: some redundant code

SAMPLE CONSOLE OUTPUT:

Valid system parameters (p, g, q)

Valid keys (sk1, pk1)

Generated new ski-pki key-pairs

Valid keys (sk2, pk2)

sk2 -> 3

pk2 -> 7303397678165652502470345190505123310599427732726477364155010654188640015865642293528798834641298197594960634429773375761668278910427466426307095015252118519619489596650029834128302327940275690793628237865456276904616694862769044519204584145467595329094918864002787238725635692517714792088332921937568167445

Valid keys (sk3, pk3)

sk3 -> 5

pk3 -> 163818460596722533180091987452979921608224681959175850464820032241124518312973428029398467132069237067184250931481147837323105554944679787289206815738226901711800714426579244849853877189315707643183775178485422288323281910386602778780422958203658009093510525532489841427342810905732009751935166961733819835818

Key1 OK -> 71

Key2 OK -> 31

message1 created -> 2270490148965092481037486522991397182298511009020671117456524017599486944563344810669635729570876654703743603683866679576329564597311994555240170965564282623631065134444776096251241595712386438474758630764629469871934261251565204487013716792279722804007430992752050714221762467517011562239670382982133016689342780933153716583697410329459006795495309180882132916472179461519000777009530456894813716230719691300429975014501150046784613628761389015969169274483231455277838443725976118207898793245895158616443333833889954416993026118416633415318949863320068446704725517831581478601643900407445258700089459360674969250305281

message2 created -> 86043969894532849445610272578458347622566264520077482100286013723400284152770751572508685569027218248725406990618435751194725608405146043265262323041928628247404895957190085245358592183329083838672585409236924645060882295569187638358894058441457406094906703449565779073899479042341763848588780938184421242990493142207824662721401524051597668385274902852708586490823241134282382883151261866300395906814543046987303201313942443181501873128291932368005589133932141276001638573730606225759670249749730112539588006433235247976936492389064309742829034751411224821978795807558462638180242724407213525791721029074001386986121729

simpleMessage1 created -> 1829974626208055121921347817596593087666157031190638920137848640353090792193774049006992533061119238277281077323890753983284247345837655572030284247570540123062830647437996155160251334119259427947921342547115516293855716940059704519513985329

simpleMessage2 created -> 270898075887682707334004652861403724879997598527472247209325788643286886040555471741189380994013116720602317814511700572507642485024126925678825986292931616932363404742276647954498168312052677323390595389430756943549502616012208114750322845

r -> 269105770324817675424681515877209589459040358127

s -> 248220774819800795052551757812571154930403145514

Sig1 created -> (269105770324817675424681515877209589459040358127, 248220774819800795052551757812571154930403145514)

u -> 26180128152841635526918211417643561725474713987

v -> 306719378675836314956942304507162090988288505439

w -> 269105770324817675424681515877209589459040358127

Sig1 verified

Transacting T1...

FOUND A PREIMAGE! -> 000000206958bfa41d3a27817773af7ee9d8aa25d8b4368daee99745

valid nonce found -> 00000000000000000000000000a280dd

r -> 561474052182132145133696462779627378633253300757

s -> 821674223850197685893089939876292785695495986272

Sig2 created -> (561474052182132145133696462779627378633253300757, 821674223850197685893089939876292785695495986272)

u -> 17135880960868038555281044876926971586194267751

v -> 633923147330011460031862048797651750904604487974

w -> 561474052182132145133696462779627378633253300757

Sig2 verified

Transacting T2...

FOUND A PREIMAGE! -> 000000cf4243b3d4f79bd037b8dbe6b85f383b75e8424f3606da7661

valid nonce found -> 000000000000000000000000002eb63b