First production-ready release of kek, the KMS Encryption Kit.
Highlights
- 🆕 Two encryption schemes. Pick the one whose decoded plaintext matches your downstream consumer:
bytes:keypair_bytes → base64 → KMS encrypt(decrypts to a 64-byteUInt8Array).base58:base58_string → base64 → KMS encrypt(decrypts to a Phantom-style base58 private key string).
- 🆕 Proper subcommand CLI built on clap derive —
kek --helpdocuments every operation. - 🆕
serialize-base58subcommand converts anid.jsonto a base58 private key string without touching KMS (replaces the previous TypeScript helper). - 🆕 Install via
install.sh— one-liner that delegates tocargo install --git. Pin a tag withKEK_REF=v0.2.0.
Commands
| Command | Purpose |
|---|---|
encrypt-keypair |
Encrypt id.json as raw bytes (UInt8Array → base64 → KMS) |
encrypt-keypair-base58 |
Encrypt id.json as a base58 string (base58 → base64 → KMS) |
decrypt-keypair (alias decrypt) |
Decrypt a bytes-scheme ciphertext |
decrypt-keypair-base58 |
Decrypt a base58-scheme ciphertext |
encrypt-message / decrypt-message |
Encrypt/decrypt arbitrary UTF-8 strings |
serialize-base58 |
Print id.json as a base58 private key (no KMS) |
Install
curl -fsSL https://raw.githubusercontent.com/mirrorworld-universe/solana-kms-keypair-encryption-kit/main/install.sh | KEK_REF=v0.2.0 bashRequires cargo (https://rustup.rs). The binary lands at ~/.cargo/bin/kek.
Security
- Hardened
.gitignoreblocksid.json,*.keypair.json,keypair*.json,*.secret,*.log, and.env*. - Live KMS round-trip test now reads
KMS_TEST_KEY_IDfrom the environment instead of a hard-coded value. - Verbose AWS metadata (KMS region, SDK version) is no longer printed on every operation.
See README.md → Security notes for guidance on stdout redirection, IAM scope, and zeroization caveats.
Breaking changes
- The CLI used to accept
kms-encryption-kit <path> <pubkey>as the default invocation. It now requires the explicitencrypt-keypair(orencrypt-keypair-base58) subcommand. - The binary is now installed as
kekrather thankms-encryption-kit. decryptstill works — it is now a visible alias ofdecrypt-keypair.
Acknowledgements
Special thanks to the team who flagged the bytes-vs-base58 ambiguity that motivated the dual-scheme design.