<p>I think what you are seeing is <em>binary</em> data being viewed using a program (or command) that expects ASCII or UTF-8 encoded character data.</p>
<p><strike>I would add <code>-base64</code> to the openssl command and see if that produces the results you expect.</strike></p>
<p>If you need the key in a different encoding (like say base58 or WIF) you might have to do that as a separate step using a second command/program.</p>
<hr />
<h2>Decrypting keys from Multibit</h2>
<p>I found some <a href="https://github.com/Multibit-Legacy/multibit/wiki/Export%20and%20limited%20import%20of%20private%20keys" rel="nofollow noreferrer">instructions for decrypting Multibit keys</a> which don't say if they are for Multibit Classic, Multibit HD or for both. It may be they only work for one and not for the other.</p>
<blockquote>
<p>This is the format of the MultiBit private key file<br />
Keys are saved in an ASCII encoded text file.<br />
There is one key per line (empty lines and lines starting with '#' are ignored).</p>
<pre><code>\&lt;Base58 encoded private key\&gt;[\&lt;any number of whitespace characters\&gt;[\&lt;key createdAt in UTC format\&gt;]] 
</code></pre>
<p>To decrypt a MultiBit private key export file use:</p>
<pre><code>openssl enc -d -p -aes-256-cbc -a -in \&lt;ciphertext file\&gt; -out \&lt;plaintext file\&gt; -pass pass:\&lt;password\&gt;
</code></pre>
</blockquote>
<p>Note that this command lacks the <code>-md md5</code> option you used. I would try this version.</p>
<p>The <a href="https://www.openssl.org/docs/man1.1.1/man1/enc.html" rel="nofollow noreferrer">OpenSSL manual page</a> says</p>
<blockquote>
<p>-md digest<br />
Use the specified digest to create the key from the passphrase. The default algorithm is sha-256.</p>
</blockquote>
<p>so this would affect decryption.</p>
<p>The results you are reporting suggest that either the instructions you used don't apply to the particular version of Multibit you used or that you don't have the correct data file or perhaps don't have the correct password.</p>
<hr />
<h2>Importing keys into Electrum</h2>
<p>According to <a href="https://bitcoinelectrum.com/importing-your-private-keys-into-electrum/" rel="nofollow noreferrer">instructions for importing keys into Electrum</a>, Electrum needs the key in <a href="https://en.bitcoin.it/wiki/Wallet_import_format" rel="nofollow noreferrer">Wallet Import Format (WIF)</a> so you'll need to convert your exported Multibit key into that format. It looks like it is easiest to start with a hexadecimal representation rather than the Base58 Multibit and others use.</p>
<p>Note that you can't just import a private key into Electrum at any time. You can only do that when you first initialise and create the Electrum wallet, not subsequently.</p>

CC BY-SA 4.0
2021-02-28T11:19:39.730Z
2021-03-01T10:13:31.573Z
2021-03-01T10:13:31.573Z
RedGrittyBrick
<p>7 years ago I exported the multibit classic wallet and private key, both encrypted. Only remember the key password now. Problems occurred when I tried to decrypt the key in following ways:</p>
<ol>
<li><p>installed MultiBit Classic 0.5.17 from web (might be dangerous).</p>
<p>Created a new wallet and tried &quot;tools--import private key&quot;. Chose the old key, input the password and clicked &quot;decrypt&quot;. The password seemed correct because there wasn't a fail note, which always appeared for other passwords.</p>
<p>Then, when I clicked &quot;import private key&quot;, a fail note said &quot;<strong>could not understand address in import file</strong>&quot;.</p>
<p>To compare I exported a new encrypted private key and followed steps above. It worked well. Though the new key had a wrong timestamp in 2014, it didn't hinder the import.</p>
</li>
<li><p>Used openssl in cmd to do direct decryption, found the only code:</p>
</li>
</ol>
<p><code>openssl enc -d -p -aes-256-cbc -md md5 -a -in multibit.key  -out key.txt  -pass 'pass:myPassword'</code></p>
<p>that can decrypt the new key successfully. When decrypting the old key, it didn't show any error either, no &quot;bad decryption&quot;. But the plain text was garbled like</p>
<blockquote>
<p>?躠磱Q?39'ad&quot;t鉼!?狡</p>
</blockquote>
<blockquote>
<p>_決[qp嗽雔紧鸘:?A濵彆r闞? &amp;*绉i#唹B7鼞_z?</p>
</blockquote>
<p>Tried lots of text-code-converter and they only gave different garbled text...</p>
<p>How would this happen? Was the old key exported incorrectly in 2013? Is there any hope?</p>

<private-key><multibit>
What if a multibit classic private key is decrypted into garbled codes?
seeker
# What if a multibit classic private key is decrypted into garbled codes?

(Asked by: username_0 on 2021-02-28)

7 years ago I exported the multibit classic wallet and private key, both encrypted. Only remember the key password now. Problems occurred when I tried to decrypt the key in following ways:

1. installed MultiBit Classic 0.5.17 from web (might be dangerous).

   Created a new wallet and tried "tools--import private key". Chose the old key, input the password and clicked "decrypt". The password seemed correct because there wasn't a fail note, which always appeared for other passwords.

   Then, when I clicked "import private key", a fail note said "**could not understand address in import file**".

   To compare I exported a new encrypted private key and followed steps above. It worked well. Though the new key had a wrong timestamp in 2014, it didn't hinder the import.
2. Used openssl in cmd to do direct decryption, found the only code:

`openssl enc -d -p -aes-256-cbc -md md5 -a -in multibit.key -out key.txt -pass 'pass:myPassword'`

that can decrypt the new key successfully. When decrypting the old key, it didn't show any error either, no "bad decryption". But the plain text was garbled like

> ?躠磱Q?39'ad"t鉼!?狡

> \_決[qp嗽雔紧鸘:?A濵彆r闞? &\*绉i#唹B7鼞\_z?

Tried lots of text-code-converter and they only gave different garbled text...

How would this happen? Was the old key exported incorrectly in 2013? Is there any hope?

**Tags:** private-key, multibit


---

## 1 answers

### Answer by username_1 on 2021-02-28. Score: 1

I think what you are seeing is *binary* data being viewed using a program (or command) that expects ASCII or UTF-8 encoded character data.

I would add `-base64` to the openssl command and see if that produces the results you expect.

If you need the key in a different encoding (like say base58 or WIF) you might have to do that as a separate step using a second command/program.

---

## Decrypting keys from Multibit

I found some [instructions for decrypting Multibit keys](https://github.com/Multibit-Legacy/multibit/wiki/Export%20and%20limited%20import%20of%20private%20keys) which don't say if they are for Multibit Classic, Multibit HD or for both. It may be they only work for one and not for the other.

> This is the format of the MultiBit private key file  
> Keys are saved in an ASCII encoded text file.  
> There is one key per line (empty lines and lines starting with '#' are ignored).
>
> ```
> \<Base58 encoded private key\>[\<any number of whitespace characters\>[\<key createdAt in UTC format\>]] 
>
> ```
>
> To decrypt a MultiBit private key export file use:
>
> ```
> openssl enc -d -p -aes-256-cbc -a -in \<ciphertext file\> -out \<plaintext file\> -pass pass:\<password\>
>
> ```

Note that this command lacks the `-md md5` option you used. I would try this version.

The [OpenSSL manual page](https://www.openssl.org/docs/man1.1.1/man1/enc.html) says

> -md digest  
> Use the specified digest to create the key from the passphrase. The default algorithm is sha-256.

so this would affect decryption.

The results you are reporting suggest that either the instructions you used don't apply to the particular version of Multibit you used or that you don't have the correct data file or perhaps don't have the correct password.

---

## Importing keys into Electrum

According to [instructions for importing keys into Electrum](https://bitcoinelectrum.com/importing-your-private-keys-into-electrum/), Electrum needs the key in [Wallet Import Format (WIF)](https://en.bitcoin.it/wiki/Wallet_import_format) so you'll need to convert your exported Multibit key into that format. It looks like it is easiest to start with a hexadecimal representation rather than the Base58 Multibit and others use.

Note that you can't just import a private key into Electrum at any time. You can only do that when you first initialise and create the Electrum wallet, not subsequently.


---

