# How to possibly regain access to wallet with .keys file if you lost the password

**URL:** <https://forum.safex.org/t/how-to-possibly-regain-access-to-wallet-with-keys-file-if-you-lost-the-password/7289>\
**Category:** Software Help\
**Created:** [December 19, 2020, 10:08pm UTC](https://forum.safex.org/t/how-to-possibly-regain-access-to-wallet-with-keys-file-if-you-lost-the-password/7289 "2020-12-19T22:08:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![caelum](https://forum.safex.org/user_avatar/forum.safex.org/caelum/32/1802_2.png) [@caelum](https://forum.safex.org/u/caelum)\
**Post date:** [December 19, 2020, 10:08pm UTC](https://forum.safex.org/t/how-to-possibly-regain-access-to-wallet-with-keys-file-if-you-lost-the-password/7289/1 "2020-12-19T22:08:09Z")

</div>

Scenario: My friend created a wallet for mining and was so excited he did not write the password down correctly. He created a wallet, entered a password, and copied the wallet address into the miner config, and let time pass. Well a month goes by and he wants to gain access to the wallet realizing he did not write down the entire password. He realizes he is locked out of his wallet without the passphrase.

Solution:  
I downloaded John the Ripper and because Safex is a fork of Monero, we are able to use John The Ripper to try and use a wordlist to create permutations and try to crack the password hash.

First download John the Ripper,

> **[John the Ripper password cracker](https://www.openwall.com/john/)**

Once you download it, we need to run monero2john on the Safex wallets .keys file to receive the hash.  
`./monero2john.py [wallet.keys file] >> myHash.txt`

If you have a unique password that you can kind of remember or possible passwords you have used in the past you can create your own wordlist which is what i did so you can narrow down the permutations, otherwise using the generic word list can take days with no hit. I created a wordlist file called `myWordlist.txt`.

Once i had my .keys file hash and a wordlist saved to separate files, i used John the Ripper to decode the hash.  
`./john --wordlist='myWordlist.txt' --rules='Single' myHash.txt`

This gave me the Safex wallet .keys file password within seconds and I was able to regain access to my friends wallet.

I hope this helps someone in the future.

~C
