Security of private keys

For every time, you create or import a new wallet, you need to decide which level of security is appropriate for you. The level of security is understood as way of saving private keys in "C:\Low Caps Hub Terminal". You have two options:

  • Protecting your assets via .dat file

  • Risking loss and keeping PK in simple .txt file

Each option has its own advantages and disadvantages. Let's consider them:

.dat files

In case of .dat files there is only one disadvantage - a small inconvenience, which requiers unlocking your wallet for every time, you open the Terminal.

def create_wallet():
    keypair = Keypair.generate()
    private_key = keypair.secret_key
    public_key = keypair.public_key
    private_key_base58 = base58.b58encode(private_key).decode('utf-8')
    directory = create_wallet_directory()
    formatted_filename = format_wallet_filename(public_key)
    filename = os.path.join(directory, f"{formatted_filename}.txt")
    wallet_data = f"Public Key: {public_key}\nPrivate Key (Base58): {private_key_base58}\n"
    return public_key, private_key_base58, wallet_data, filename

.txt files

Keeping private keys without protection is a very dangerous attitude. However, we aren't going to limit our users, if someone decide to be exposed, we respect that whereas, we would like to underline a few of most common meances:

  • Malicious software. There are tons of undesirable "adds" which are downloading by you unintentionally. When your computer is infected by sophisticated software, their main point is usually to steal as much of sensitive data as possible. If its target is crypto, the malicius programs, usually looking forward the most common standard - PK saved in BIP-39 (well-known 12 or 24 words). However, we can't exclude that some of them searching less common forms, like using by us Base58.

Besides, you can't ignore regular threats, like unauthorized access.

Last updated