Image for post
Image for post
Photo by Simon Rae on Unsplash

abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon cactus

What happens when you can’t access your cryptowallet, and you have forgotten your password? Well, hopefully, you have stored the encryption key used by storing a 12-word phase:

Image for post
Image for post

So, how do we recover this? Well we can use BIP39 and which is a Deterministic Key Generation method. With this we can derive an encryption keys for a known phrase. In the BIP39 standard there are 2,048 words, and if each phrase has 12 worlds, then there are 2048¹² different permutation — giving 2¹³² different bit values (or 132 bits) . The first few words are [list]:

The Golang code to covert is [here]:

A sample run is:

To do the reverse [here]:

A sample run is:

For this we basically take the phrase, and then “mnemonic”+password as the salt, and perform 2,048 iterations for PBKDF2 for a SHA-512 output (512 bits). Now we will test this with Python:

When we run this we get:

and which is the same the previous run in Golang.

Any there you go. The best security that you can have for cryptocurrency is to keep a paper wallet, and not put your digital wallet on-line.

Written by

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. EU Citizen. Auld Reekie native. Old World Breaker. New World Creator.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store