Author

Topic: How to decode an encrypted WIF key ? (Read 383 times)

newbie
Activity: 12
Merit: 2
March 06, 2019, 01:08:43 PM
#12
Hi,

THANK YOU VERY MUCH, IT WORKS !!! I have successfully unlocked my BTG's .
legendary
Activity: 3710
Merit: 1586
March 06, 2019, 12:07:45 PM
#11
Yeah sorry I didn't mention that the site had to be loaded first. Kinda forgot Tongue
legendary
Activity: 3472
Merit: 3217
Playbet.io - Crypto Casino and Sportsbook
March 06, 2019, 12:05:22 PM
#10
Both of them works @HCP method you just need to use this code first .

Code:
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js';
document.head.appendChild(script);

Before we insert Abdussamad code.

And now it works fine it shows the wif key on the screen.

For the pooya87 suggestion, it also works.

Just we need to send the Abdussamad code while you are in coinb.in website page.

What I did lately is I just send the code from Abdussamad to a new tab that is why I see bad result "ReferenceError: CryptoJS is not defined"
legendary
Activity: 3472
Merit: 10611
March 06, 2019, 12:01:40 AM
#9
I tried as your suggestion it doesn't work in firefox it always shows "ReferenceError: CryptoJS is not defined"
I was getting the same... I think maybe Abdussamad already had the CryptoJS stuff loaded (browser extension maybe?)... try running my little code snippet to load the aes.js script and see if that helps! Wink

open https://coinb.in/ website first and then bring up the browser's inspect window (developers tool or whatever else it is called in other browsers) and then type those commands in. when you open the site, CryptoJS is already loaded that way you don't have to go through the trouble of manually loading anything.
HCP
legendary
Activity: 2086
Merit: 4363
March 05, 2019, 06:29:26 PM
#8
Edit: Actually you can use your browser's developer tools to decrypt the priv key.
Took some messing around to make this work on Chrome (Press F12 to get console)... It doesn't seem to have the CryptoJS stuff auto imported? Huh

I had to first of all copy/paste this code snippet into the console to get access to the CryptoJS library... the source code for which is no longer available on code.google.com Undecided So, I'm using some random link I found while googling for it Tongue
Code:
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js';
document.head.appendChild(script);

Then, I could copy/paste the following code into the console and it would pop up the alert showing the private key.
Code:
var mencrypted = "enter encrypted priv key here";
var mpassword = "enter password here";
var decrypted = CryptoJS.AES.decrypt(mencrypted, mpassword);
alert(decrypted.toString(CryptoJS.enc.Utf8));


If you try and copy/paste the whole lot in one go... it'll complain that CryptoJS doesn't exist:
I tried as your suggestion it doesn't work in firefox it always shows "ReferenceError: CryptoJS is not defined"
I was getting the same... I think maybe Abdussamad already had the CryptoJS stuff loaded (browser extension maybe?)... try running my little code snippet to load the aes.js script and see if that helps! Wink
legendary
Activity: 3472
Merit: 3217
Playbet.io - Crypto Casino and Sportsbook
March 05, 2019, 06:15:22 PM
#7
Edit: Actually you can use your browser's developer tools to decrypt the priv key. For example on firefox ctrl+shift+k should bring up the js console. There you can decrypt the priv key with the following code:

Code:
var mencrypted = "enter encrypted priv key here";
var mpassword = "enter password here";
var decrypted = CryptoJS.AES.decrypt(mencrypted, mpassword);
alert(decrypted.toString(CryptoJS.enc.Utf8));

Source
I tried as your suggestion it doesn't work in firefox it always shows "ReferenceError: CryptoJS is not defined"

Look at the reference below.
legendary
Activity: 3710
Merit: 1586
March 05, 2019, 05:25:34 PM
#6
Edit: Actually you can use your browser's developer tools to decrypt the priv key. For example on firefox ctrl+shift+k should bring up the js console. There you can decrypt the priv key with the following code:

Code:
var mencrypted = "enter encrypted priv key here";
var mpassword = "enter password here";
var decrypted = CryptoJS.AES.decrypt(mencrypted, mpassword);
alert(decrypted.toString(CryptoJS.enc.Utf8));

Source
legendary
Activity: 3472
Merit: 3217
Playbet.io - Crypto Casino and Sportsbook
March 05, 2019, 04:19:39 PM
#5
I think you need OpenSSL for this to decrypt your AES-256 Encrypted WIF key.

Anyway, Let me test if I can decrypt your encrypted WIF key.

Edit:
It seems OpenSSL doesn't work to me or there is something wrong with my command.

I used this command

Code:
enc -d -aes-256-cbc -p -md md5 -a -in plain1.txt -out plaind1.txt
The encrypted wif key I just paste it inside the plain1.txt

But the result is an "error reading input file".

I think we need to know if what cipher type that coinb.in used?
newbie
Activity: 12
Merit: 2
March 05, 2019, 02:42:38 PM
#4
Hi,
Many thanks for your help. I tryed both but my encrypted WIF key is not recognised. I got the message bellow
" The text you entered is not a valid Private Key! Would you like to use the entered text as a passphrase and create a Private Key using a SHA256 hash of the passphrase?"

The encrypted WIF key I am talking about is for Bitcoin Gold. It has 108 characters.

Here is an example of an encrypted wif key and it's corresponding wif key and password that i have generated here (https://coinb.in/#newAddress) for testing purpose
WIF key : "KyYEjVKDcbUrgfrpdpzaZBm1szWbzTmrBvxsQzDWgCAAZnd6uw8S"
AES-256 Encrypted WIF key : "U2FsdGVkX187FiUTQ0lMNeO5AkYQS9xU874h0g4AWch3ZfLuKEiUndejRQ0uRGw03sY5tOlTiVyiLf4 oax+6IGF7hJUAjOMEomCGOxd8jvg="
Password : "123"
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
March 05, 2019, 07:48:06 AM
#3
Let me add the details:

  • 1. Go to bitaddress' Github page: https://github.com/pointbiz/bitaddress.org and download the source (zip).
  • 2. Turn off your internet connection, Extract and open it (drag&drop bitaddress.org.html) to your browser.
  • 3. Move your mouse until the 1st address reach 100%, then click "Wallet Details".
  • 4. Check "BIP38 Encrypt?", enter your encrypted key and passphrase, hit "Encrypt BIP38" (sometimes, it changes to "Decrypt" after clicking).
  • 5. After loading, your WIF private key should show up.

Image: (Random key from the internet: please don't import)

legendary
Activity: 3612
Merit: 5297
https://merel.mobi => buy facemasks with BTC/LTC
March 05, 2019, 07:26:37 AM
#2
I don't really have time for a complete explanation (late for a meeting), but if you download the sourcecode of https://www.bitaddress.org/ from github, disconnect your pc from the internet, open the main page, go to wallet details and enter WIF + pass, you should get all other formats as output
newbie
Activity: 12
Merit: 2
March 05, 2019, 07:18:51 AM
#1
H,

Please can you tell me how to get "Private key (WIF key)" from an "AES-256 Encrypted WIF key" ?
I have created a BTG adress on coinb.in, I have the AES-256 Encrypted WIF key and my password but I do not know how to decode it.

Thank you.
Jump to: