Cryptography

Bitcoin address generation in pure python

published on
Bitcoin address generation can be split in 4 steps listed bellow: Generating a secure private key. Calculate the public key from the private key. Encode the public key as a bitcoin address. Encode the private key in the WIF format. Step 1: Generate ECDSA Keypair The very first step is to select a good and secure number, for this example we won’t use one, instead we will simply get the random from the system. Read More...

Bitcoin transaction nonce reuse vulnerability

published on
This post aims to analyse an attack against the Bitcoin, in this attack were Found 123 vulnerable transactions and 416 private keys were recovered summing up 26.85729198 btcs (2685729198 satoshis) could have been compromised, which at this exact moment worth 166,219.51 dollars. Cryptographic concept of the attack When the nonce is reused it become vulnerable and result in a trivial equation to be solved. $$ Key=((r \times (s_1 - s_2))^{p - 2} \mod{p}) \times ((m_1 \times s_2) - (m_2 \times s_1)) \mod{p} $$ Read More...