Simply python library for encrypting private keys using character shuffle method
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file key_shuffler-0.1.1.tar.gz.
File metadata
- Download URL: key_shuffler-0.1.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd537c0606dcd622929298ab59e10f380196147db67e86743d546a9b75625b54
|
|
| MD5 |
e861bb66a0cee03de393bec20ba2fe48
|
|
| BLAKE2b-256 |
c9d0b6359d7ff6abf8f98a7ce2aec6f4cd255e687f2eb54c930fbffab959ed1c
|