Skip to content

Instantly share code, notes, and snippets.

@Medeah
Created September 15, 2015 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Medeah/f0437113501c6b370695 to your computer and use it in GitHub Desktop.
Save Medeah/f0437113501c6b370695 to your computer and use it in GitHub Desktop.
Recover private key from vertpunk wallet
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!--This is free and unencumbered software released into the public domain.-->
<title>Recover private key</title>
<script src="https://cdn.rawgit.com/bitwiseshiftleft/sjcl/1.0.3/sjcl.js"></script>
<script>
function submit() {
var id = document.getElementsByTagName('input')[0].value;
var password = document.getElementsByTagName('input')[1].value;
var encryptedJSON = document.getElementsByTagName('textarea')[0].value;
try {
var walletKey = sjcl.codec.base64.fromBits(sjcl.misc.pbkdf2(password, id, 1000));
var payloadJSON = sjcl.decrypt(walletKey, encryptedJSON);
var payload = JSON.parse(payloadJSON);
} catch (e) {
document.getElementById('res').innerHTML = e;
return false;
}
document.getElementById('res').innerHTML = 'Keys recovered!!<br/><br/>';
payload.keyPairs.forEach(function(e) {
var res = 'Name: ' + e.name + '<br/>';
res += 'Address: ' + e.address + '<br/>';
res += 'Public Key: ' + e.publicKey + '<br/>';
res += 'Private Key: ' + e.key + '<br/><br/>';
document.getElementById('res').innerHTML += res;
document.getElementById('link').style.display = 'block';
})
}
</script>
</head>
<body>
<p>If you have a Vertpunk wallet backup, this allows you to recover the keys from it. You need the email address
and password that were in use when the backup was made. </p>
<p>Your info will not leave your computer. If you are truly paranoid you can disconnect from the internet before
entering your info. Or you could just read the source. </p>
<input type="text" placeholder="Your wallet email">
<p />
<input type="password" placeholder="Your wallet password">
<p />
<textarea placeholder="Contents of wallet file"></textarea>
<p />
<button onclick="submit()">Recover info</button>
<pre id="res"></pre>
<a style="display: none" id="link" href="https://www.reddit.com/r/vertcoin/comments/1x45vt/how_to_import_a_private_key_from_a_paper_wallet/cf805hz">How to import a private key in the vertcoin wallet</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment