create account

How to Decode Your Inleo Keystore File Hive Keys? by forkyishere

View this thread on: hive.blogpeakd.comecency.com
· @forkyishere · (edited)
$1.84
How to Decode Your Inleo Keystore File Hive Keys?
Hey everyone,

Since I have seen a couple of people using my #inleo referral, and recognizing that my attempt on reaching out might actually not be possible. I have decided to call for forces within the skilled enough (and with free time to produce something that will help the user in these cases).

# What am I talking about?

![](https://img.leopedia.io/DQmZqCWHWWSH2vDvkEs8r7T8Z7jzviwogpmSeE7MFqaBZup/image.png)

As you can see, I have a bunch of referred people, of which the only one I know on the chain is @finpulse. The rest basically either want to give me referral rewards or are failed attempts, because they don't continue their experience on the chain.

And given some of them reported not understanding where their keys are... I then attempted to replicate the mistake/issue I think it is, and understand if there was anything I could help with.

# What do you need for this?
Unfortunately, this is not a simple tool you can use, and it requires a bit of software skills for you to understand what I am going to explain. But in a broader perspective and strategy, this post will fit anyone else who would like to develop such too, still protecting people's keys by making sure when users use it, they will not accidentaly share or expose their private keys.

# Problem Description?
People create a #inleo account, using the keystore method most of the time (because it's the recommended one). And when storing their keystore file, they forget completely to store the individual Hive Keys (especially the owner one).

Why is it important? Well, most people don't know how to generate the keys from the Master Password, which in #inleo UI, is represented by the "seed phrase". And then they feel (or might) security-wise afraid of progressing further with that account. One should never feel like that, and knowing ALL your keys is something you have to keep remmembering that is 100% essencial to have at all times. Because if there is any problem where you need to react, you will need them! And waiting for learning could cost you the attack (someone doing) or your own mistake.

So, **YOU SHOULD** always **KNOW, ALL** your #Hive `private keys`! **AT ALL TIMES**... *even if you don't know what to do with them.*

Note: Most people might be quite familiar with Hive Keychain, and they get used to use either individulay their keys, or the master password. But on other UX/UIs/tools you can use the owner key to save your ass or do other geeky things.

# Right, let's begin!

Requirements:
1. **Your Keystore file**
2. Your Keystore file **password** (you entered/created this password before you downloaded your keystore file)
3. A Linux-based system

### Preparation
You need a couple of tools to accomplish this... like nodejs, python, and beem (a library/tool, to interface with hive).

On your Linux system (I am going to use Ubuntu):

```
sudo apt install nodejs python pip
pip install beem
npm install @xchainjs/xchain-crypto
```

### Creating the scripts

Lets create a little space for us to work...

```
mkdir decrypt_keystore
# Then copy your inleo-ACCOUNT.json here and rename it to keystore.json
```

Create this JS file (use VIM 🤓 or any other editing tool). This should be the content of the script `decrypt_keystore.js`:
```
const { decryptFromKeystore } = require('@xchainjs/xchain-crypto');
const fs = require('fs');

// Load the keystore file
const keystore = JSON.parse(fs.readFileSync('./keystore.json', 'utf8'));
const password = "YOUR_PASSWORD_OF_THE_KEYSTORE_FILE" // You should replace the CAPS letters with your real password... and please remove it afterwards.

// Decrypt the keystore
async function decryptKeystore() {
  try {
    const phrase = await decryptFromKeystore(keystore, password);
    console.log("Decrypted Seed Phrase:", phrase);
  } catch (error) {
    console.error("Error decrypting keystore:", error.message);
  }
}

decryptKeystore();
```

Nice, so now we can decrypt the keystore file using JS... but before we do that, we should just create the python script that will show all your account keys, using the "seed password" that will be decrypted from the nodejs script.


Create a file called, for example, `generate_hive_keys.py` with the following code snippet:
```
from beemgraphenebase.account import PasswordKey

# Input your Hive username and master password
username = input("Enter your Hive username: ")
master_password = input("Enter your master password: ")

# Define the roles for Hive keys
roles = ["owner", "active", "posting", "memo"]

# Generate and print keys for each role
print("\nYour Hive Keys:")
for role in roles:
    # Generate private key
    private_key = PasswordKey(username, master_password, role)
    priv_key = str(private_key.get_private_key())
    # Derive public key from private key
    pub_key = str(private_key.get_private_key().pubkey)
    print(f"{role.capitalize()} Private Key: {priv_key}")
    print(f"{role.capitalize()} Public Key: {pub_key}")
    print("(♥_♥)")
```

# Now you just execute things...
The reason I am explaining like this is to be sure you understand that this should be executed on a machine you trust that has not been compromised. Please don't use VMs on the web if you don't trust them.

```
node decrypt_keystore.js
# The output of this should be your seed phrase, assuming your password that you replaced under the YOUR_PASSWORD_OF_THE_KEYSTORE_FILE part, otherwise it will say your password is wrong.
# After seeing your seed phrase (record it in a safe place, because with this, ANY of your HIVE keys can be derived).
python3 generate_hive_keys.py
Enter your Hive username: <TYPE_THE_ACCOUNT_HERE_OF_YOUR_KEYSTORE_FILE>
Enter your master password: <PASTE_YOUR_SEED_PHRASE_HERE>
```

You will then get an output similar to this:

```
Your Hive Keys:
Owner Private Key: <PRIV_KEY>
Owner Public Key: <PUB_KEY>
(♥_♥)
Active Private Key: <PRIV_KEY>
Active Public Key: <PUB_KEY>
(♥_♥)
Posting Private Key: <PRIV_KEY>
Posting Public Key: <PUB_KEY>
(♥_♥)
Memo Private Key: <PRIV_KEY>
Memo Public Key: <PUB_KEY>
(♥_♥)
```

Copy those priv keys to a secure place, and there you go!

# All done...

Now you can import stuff into @keychain or use any tools that require specific keys.

# Didn't understand a word I said?
No worries... and if you need help recovering your keys, ping me anywhere... I will try to help you as soon as I can - (please indicate the urgency if it's urgent... as I sometimes check stuff and plan for later to respond due to time constraints).

# With 💕
From @atexoras.witness

### 👉 Vote for Witnesses

([Quick⚡Vote4me](https://vote.hive.uno/@atexoras.witness)) - Or vote for __HIVE__ witnesses [here](https://peakd.com/me/witnesses) - *voting uses staked HIVE*
([Quick⚡Vote4me](https://votify.vercel.app/atexoras.witness)) - Or vote for __Hive-Engine__ witnesses [here](https://tribaldex.com/witnesses) - *voting uses staked [WORKERBEE](https://tribaldex.com/trade/WORKERBEE)*



Posted Using [INLEO](https://inleo.io/@forkyishere/how-to-decode-your-inleo-keystore-file-hive-keys-fzv)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 138 others
properties (23)
authorforkyishere
permlinkhow-to-decode-your-inleo-keystore-file-hive-keys-fzv
categoryinleo
json_metadata{"app":"leothreads/0.3","format":"markdown","tags":["inleo","decrypt","keystore","file","hive","keys"],"canonical_url":"https://inleo.io/@forkyishere/how-to-decode-your-inleo-keystore-file-hive-keys-fzv","links":["https://img.leopedia.io/DQmZqCWHWWSH2vDvkEs8r7T8Z7jzviwogpmSeE7MFqaBZup/image.png)","https://vote.hive.uno/@atexoras.witness))","https://peakd.com/me/witnesses)","https://votify.vercel.app/atexoras.witness))","https://tribaldex.com/witnesses)","https://tribaldex.com/trade/WORKERBEE)*","https://inleo.io/@forkyishere/how-to-decode-your-inleo-keystore-file-hive-keys-fzv)"],"images":[],"isPoll":false,"dimensions":{}}
created2025-06-02 11:04:09
last_update2025-06-02 11:57:24
depth0
children6
last_payout2025-06-09 11:04:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value1.844 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length7,032
author_reputation41,355,800,360,215
root_title"How to Decode Your Inleo Keystore File Hive Keys?"
beneficiaries
0.
accountcommentrewarder
weight300
1.
accountforky.travels
weight9,700
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,117,995
net_rshares11,484,921,799,340
author_curate_reward""
vote details (202)
@commentrewarder · (edited)
@forkyishere, I paid out 0.119 HIVE and 0.027 HBD to reward 1 comments in this discussion thread.
properties (22)
authorcommentrewarder
permlinkre-forkyishere-how-to-decode-your-inleo-keystore-file-hive-keys-f16292
categoryinleo
json_metadata{"app":"CommentRewarder"}
created2025-06-05 11:04:30
last_update2025-06-09 11:04:42
depth1
children0
last_payout2025-06-12 11:04:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length97
author_reputation45,419,688,921,929
root_title"How to Decode Your Inleo Keystore File Hive Keys?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,178,684
net_rshares0
@dantrin ·
This is very helpful!
properties (22)
authordantrin
permlinkre-forkyishere-202562t201926236z
categoryinleo
json_metadata{"links":[],"type":"comment","tags":["inleo","decrypt","keystore","file","hive","keys"],"app":"ecency/3.3.3-mobile","format":"markdown+html"}
created2025-06-02 12:19:27
last_update2025-06-02 12:19:27
depth1
children1
last_payout2025-06-09 12:19:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length21
author_reputation30,737,678,245,311
root_title"How to Decode Your Inleo Keystore File Hive Keys?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,119,178
net_rshares0
@forkyishere ·
@forkyishere "Hope more people learn about crypto. These things..."
Hope more people learn about crypto.

These things are valid for many chains, and the methods of learning are very similar. Hive can have a huge opportunity to teach everyone on the crypto community.

This experience allied to the fact that we are decentralized and not prone to pressure by governments, makes it the perfect excuse to make a lot of our SOUND roar!
properties (22)
authorforkyishere
permlinkre-dantrin-kesmcagf
categoryinleo
json_metadata{"app":"leothreads/0.3","format":"markdown","tags":["leofinance"],"canonical_url":"https://inleo.io/threads/view/forkyishere/re-dantrin-kesmcagf","isPoll":false,"pollOptions":{},"dimensions":[]}
created2025-06-02 12:22:27
last_update2025-06-02 12:22:27
depth2
children0
last_payout2025-06-09 12:22:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length364
author_reputation41,355,800,360,215
root_title"How to Decode Your Inleo Keystore File Hive Keys?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,119,246
net_rshares0
@finpulse ·
I still remember how difficult it was for me to manage my keys through keystore and you helped me a lot. I do not understand too much of coding but I think you made the process simple and easy
👍  
properties (23)
authorfinpulse
permlinkre-forkyishere-sx8a1t
categoryinleo
json_metadata{"tags":["inleo"],"app":"peakd/2025.5.9","image":[],"users":[]}
created2025-06-02 12:15:30
last_update2025-06-02 12:15:30
depth1
children1
last_payout2025-06-09 12:15:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length192
author_reputation61,501,891,216,101
root_title"How to Decode Your Inleo Keystore File Hive Keys?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,119,120
net_rshares6,725,474,157
author_curate_reward""
vote details (1)
@forkyishere ·
$0.08
@forkyishere "You were a very special user! Thank you for contin..."
You were a very special user! Thank you for continuing to explore #hive!
 https://media.tenor.com/zSOQcjz2NfoAAAAC/proud-so.gif 
👍  
properties (23)
authorforkyishere
permlinkre-finpulse-kxh2x3gd
categoryinleo
json_metadata{"app":"leothreads/0.3","format":"markdown","tags":["leofinance"],"canonical_url":"https://inleo.io/threads/view/forkyishere/re-finpulse-kxh2x3gd","links":[],"images":["https://media.tenor.com/zSOQcjz2NfoAAAAC/proud-so.gif"],"isPoll":false,"pollOptions":{},"dimensions":[]}
created2025-06-02 12:24:42
last_update2025-06-02 12:24:42
depth2
children0
last_payout2025-06-09 12:24:45
cashout_time1969-12-31 23:59:59
total_payout_value0.039 HBD
curator_payout_value0.039 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length128
author_reputation41,355,800,360,215
root_title"How to Decode Your Inleo Keystore File Hive Keys?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,119,289
net_rshares244,802,981,695
author_curate_reward""
vote details (1)
@hivebuzz ·
Congratulations @forkyishere! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

<table><tr><td><img src="https://images.hive.blog/60x70/https://hivebuzz.me/@forkyishere/replies.png?202506040535"></td><td>You got more than 5250 replies.<br>Your next target is to reach 5500 replies.</td></tr>
</table>

<sub>_You can view your badges on [your board](https://hivebuzz.me/@forkyishere) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Check out our last posts:**
<table><tr><td><a href="/hive-122221/@hivebuzz/pum-202505-delegations"><img src="https://images.hive.blog/64x128/https://i.imgur.com/fg8QnBc.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202505-delegations">Our Hive Power Delegations to the May PUM Winners</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pud-202506-feedback"><img src="https://images.hive.blog/64x128/https://i.imgur.com/zHjYI1k.jpg"></a></td><td><a href="/hive-122221/@hivebuzz/pud-202506-feedback">Feedback from the June Hive Power Up Day</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pum-202505-result"><img src="https://images.hive.blog/64x128/https://i.imgur.com/mzwqdSL.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202505-result">Hive Power Up Month Challenge - May 2025 Winners List</a></td></tr></table>
properties (22)
authorhivebuzz
permlinknotify-1749015710
categoryinleo
json_metadata{"image":["https://hivebuzz.me/notify.t6.png"]}
created2025-06-04 05:41:48
last_update2025-06-04 05:41:48
depth1
children0
last_payout2025-06-11 05:41:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,471
author_reputation369,406,043,183,063
root_title"How to Decode Your Inleo Keystore File Hive Keys?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,153,260
net_rshares0