TE
TechEcho
Home
24h Top
Newest
Best
Ask
Show
Jobs
English
GitHub
Twitter
Home
Show HN: Offline auditable BTC address generator using only common *nix tools
2 points
by
ribasushi
almost 6 years ago
1 comment
ribasushi
almost 6 years ago
Both tweets joined together:<p><pre><code> openssl ecparam -noout -name secp256k1 -genkey \ | tee >( lpr ) \ | openssl ec -pubout -conv_form compressed -outform DER \ | tail -c33 \ | rhash - -p %@{sha-256} \ | rhash - -p %@{ripemd160} \ | perl -Mbigint -MDigest::SHA=sha256 -0777 -nE ' ( $k = "\0$_" ) =~ /^\0*/; $l = 1 x $+[0]; $k .= substr sha256(sha256 $k), 0, 4; $d = hex unpack "H*", $k; $a = ( grep /[^IOl]/, 1..9,A..Z,a..z )[ ($d->bdiv(58))[1] ] . $a while $d; say $l . $a; ' </code></pre> Replace `>( lpr )` wih `>( cat >/dev/stderr )` to see it in action without a printer