A simple and fast CLI tool for asymmetric encryption, decryption, key generation, and signing — written in Go using the Cobra framework.
go install github.com/petqoo/cryptik@latestOr build from source:
git clone https://github.com/petqoo/cryptik.git
cd cryptik
go build -o cryptikcryptik [command] [subcommand] [flags]Generate RSA keypair and output as PEM files:
cryptik asym keygen --type rsa --bits 2048 --out ./keysEncrypt plaintext using a public key:
cryptik asym encrypt --input "secret message" --pubkey ./keys/public.pem
# or from file
cryptik asym encrypt --file ./secret.txt --pubkey ./keys/public.pemDecrypt ciphertext using a private key:
cryptik asym decrypt --file ./secret.enc --privkey ./keys/private.pemSign a message or file using a private key:
cryptik asym sign --input "important data" --privkey ./keys/private.pem
# or from file
cryptik asym sign --file ./data.txt --privkey ./keys/private.pemVerify a signature using a public key:
cryptik asym verify --input "important data" --pubkey ./keys/public.pem --signature ./sig.binRun
cryptik help [command]for detailed usage of each.
| Command | Description |
|---|---|
asym keygen |
Generate RSA keypair |
asym encrypt |
Encrypt with public key |
asym decrypt |
Decrypt with private key |
asym sign |
Sign with private key |
asym verify |
Verify signature with public key |
sym |
Symmetric encryption/decryption |
hash |
Hash strings or files |
hmac |
Generate/verify HMACs |
encode / decode |
Encode/decode data in base64, hex, etc. |
Global flags:
--help Show help message
--version Print version info
Each subcommand may also have its own flags (e.g., --input, --output, --privkey, --pubkey).
For detailed documentation, usage examples, and API reference, visit the docs directory.
This project is licensed under the MIT License.
See the LICENSE file for details.
If you encounter a bug or have a feature request:
Open an issue here: issues Please include:
- Steps to reproduce
- Expected vs actual behavior
- Your OS and Go version
- Any relevant logs or stack traces
Made by Walid