Secure wallet management utilities with encrypted private key and mnemonic storage.
- AES-256-CBC encryption compatible with OpenSSL
- HD wallet generation with encrypted mnemonic storage
- Private key encryption for secure
.envstorage - Password-protected decryption using hidden input (getpass)
npm installnode wallet_manager.mjs encrypt-private-key
# Enter private key to encrypt (hidden): [paste your key]
# Enter encryption password: [hidden]
# Enter password again: [hidden]node wallet_manager.mjs encrypt-text
# Enter text to encrypt (hidden): [type/paste]
# Enter encryption password: [hidden]
# Enter password again: [hidden]node wallet_manager.mjs decrypt-text <encrypted_text> <salt_base64>
# Enter the decryption password: [hidden]node wallet_manager.mjs make-hdwallet [derivation_index]
# Enter the password: [hidden]
# Enter the password again: [hidden]import {
encrypt_text,
decrypt_text,
decrypt_mnemonic,
decrypt_private_key,
make_hd_wallet
} from './wallet_manager.mjs';
// Encrypt text
const { salt, encrypted_text } = await encrypt_text('secret', 'password');
// Decrypt text
const decrypted = await decrypt_text(encrypted_text, 'password', Buffer.from(salt, 'base64'));
// Decrypt private key with password prompt
const privateKey = await decrypt_private_key({ salt, encrypted_text });
// Decrypt mnemonic with password prompt
const mnemonic = await decrypt_mnemonic({ salt, encrypted_text });Store encrypted keys in your .env:
ENCRYPTED_PRIVATE_KEY='{"salt":"...","encrypted_text":"..."}'
ENCRYPTED_WALLET='{"salt":"...","encrypted_text":"..."}'ISC