keepmesafe
v1.1.1
Published
Stop storing your private keys in plain text! Keep them secret and encrypted
Downloads
15
Readme
User Documentation for keepmesafe
Package
keepmesafe
is a command-line utility designed to securely manage and store private keys using ERC-2335 standards. It provides an interactive interface for adding, listing, deleting accounts, and managing encryption passwords.
npm
Quickstart
Get started quickly with these simple steps:
npm install -g keepmesafe # Install keepmesafe globally
npx keepmesafe@latest # Run keepmesafe
Getting Started
Installation
Install the package globally using:
npm install -g keepmesafe
yarn install -g keepmesafe
pnpm install -g keepmesafe
Using the Command-Line Interface
Encrypt and Store Your Private Key.
Run the command:
npx keepmesafe@latest
yarn keepmesafe@latest
pnpm keepmesafe@latest
You will be prompted to provide your private key, encryption password, and an account name.
Options:
-pk, --private-key [value]: Directly provide a private key.
-p, --password [value]: Specify a secret key for decryption.
-a, --account-name [value]: Provide an account name for the private key.
-d, --delete [value]: Delete a specified account.
-hmp, --hide-my-privates: Create a precommit git hook to prevent you from pushing API keys
-la, --accounts: List all accounts in the keystore.
Note: Encrypted keys are stored in ~/pancerna/keystore.json.
Storing and Managing Your Password with keepmesafe
How to Store the Password
Upon setup, you'll be prompted to insert an encryption password. A 32-character hexadecimal password is generated if you don't provide one.
Where to Store the Password
The encryption password will be stored in a .password file in the root directory where you run the tool.
Extra Security Tips
Backup your .password file. Maintain strict Access Control. Consider External Storage for the .password file. Note: The .password file is automatically added to .gitignore.
Using Functions in Your Code
Retrieving Encrypted Private Key
Use betterKey or betterKeyAsync to decrypt and retrieve your private key.
import { betterKey } from "keepmesafe";
const fetchKey = async () => {
const key = await betterKey("accountName");
// Output: decrypted key
};
fetchKey();
Convert your private key back to hexadecimal
const fetchKey = async () => {
const key = await betterKey("accountName").toHex();
// Output: hexadecimal key
};
fetchKey();
Contributions
We welcome contributions from the community! Please refer to our contributing guidelines for more information.
Maintainers
Changelog
V1.1.1: New command --hide-my-private to create git precommit hooks and prevent devs from pushing hard coded private keys.
V1.0.1: Inline options for key management. Automated .password file creation and .gitignore updates. For support or contribution, please refer to our GitHub Repository.
License This project is licensed under MIT.