Skip to main content

Simply python library for encrypting private keys using character shuffle method

Project description

Telegram channel PyPI version image Github last commit date works badge

key_shuffler

Simply python library for encrypting private keys using character shuffle method.

Supports any blockchains, but is guaranteed to mask only EVM/Aptos private keys.

It checks the correctly entered password by checking the case of the last 2 characters of the key.

Accepts wallets in the format: address:key or key


Installation

pip install key-shuffler

Usage

Encrypt/decrypt key

from key_shuffler import KeyShuffler

a) The password is already set in the variable:

private_key = "........"
passphrase = "Hello world" 

shuffler = KeyShuffler(passphrase)
encrypted_key = shuffler.encrypt_private_key(private_key)
decrypted_key = shuffler.decrypt_private_key(encrypted_key)

b) The password will be specified by the user via the terminal:

private_key = "......."

shuffler = KeyShuffler()
encrypted_key = shuffler.encrypt_private_key(private_key)
decrypted_key = shuffler.decrypt_private_key(encrypted_key)

Encrypt/decrypt file

Fast sync/async encrypt: using the context manager:

from key_shuffler import openEncrypted

with openEncrypted(".....", 'r') as file:
    ...
from key_shuffler import aiofilesOpenEncrypted

async with aiofilesOpenEncrypted(".....", 'r') as file:
    ...

Default:

shuffler = KeyShuffler()

wallets = shuffler.encrypt_from_file(file_wallets)
wallets = shuffler.decrypt_from_file(file_wallets)

shuffler.encrypt_file_to_file(file_wallets, file_encrypted_wallets)
shuffler.decrypt_file_to_file(file_encrypted_wallets, file_wallets)

Handling an input error

If the password is incorrect, there will be an error and you will be asked to enter it again:


DONATE (EVM CHAINS) - 0xd8dcc73675a36f618fe780049429ec66f8402199

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

key_shuffler-0.1.1.tar.gz (4.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page