Method Signature
Parameters
string
required
The private key to encrypt
string
required
Password for encryption (use a strong password!)
Returns
string
The wallet’s public address
string
The encrypted keystore JSON string
Examples
- TypeScript
- JavaScript
Complete Encryption/Decryption Flow
Encryption uses scrypt key derivation, which is deliberately slow (~3-5
seconds) to resist brute-force attacks.
Related Methods
From Encrypted
Decrypt a wallet
Create Wallet
Create new wallet