How astrorick/cloak works
Cloak is a command-line file encryption and decryption tool, with key-generation and password-generation utilities. The main command handler validates inputs and selects credentials and crypto options, then handles file output; password-based operations derive a key, while key-based operations load or generate one. The README also documents algorithm/method listing and version commands. Source excerpts show several calls, but omit parts of the command handlers, so some documented feature links are grounded in the README rather than inspected handler code.
Main entry points: main.go Command workflows · keygen.go Password KDF registry · algos.go Algorithm registry · utils.go File and prompt helpers
Components 12
CLI workflows
- Command workflows
cmd/cloak/main.go - Password generation
pkg/pswgen/pswgen.go
Key management
- Key generation
pkg/keygen/keygen.go - Password KDF registry
pkg/keygen/keygen.go - Argon2id
pkg/keygen/methods/argon2.go - PBKDF2
pkg/keygen/methods/pbkdf2.go
Encryption algorithms
- Algorithm registry
pkg/algos/algos.go - AES-GCM
pkg/algos/aead/aesgcm.go - ChaCha20-Poly1305
pkg/algos/aead/chacha20poly1305.go
Input utilities
- File and prompt helpers
pkg/utils/utils.go
Other components
- CLI user
- Input and output files
Connections 12
- CLI user → Command workflows: runs commands
README.md - Command workflows → Input and output files: reads and writes
cmd/cloak/main.go - Command workflows → File and prompt helpers: checks and prompts
cmd/cloak/main.go - Command workflows → Key generation: generates keys
cmd/cloak/main.go - Command workflows → Password KDF registry: derives keys
cmd/cloak/main.go - Command workflows → Algorithm registry: selects algorithm
README.md - Command workflows → Password generation: generates passwords
README.md - File and prompt helpers → Password generation: validates passwords
pkg/utils/utils.go - Password KDF registry → Argon2id: registers
pkg/keygen/keygen.go - Password KDF registry → PBKDF2: registers
pkg/keygen/keygen.go - Algorithm registry → AES-GCM: registers
pkg/algos/algos.go - Algorithm registry → ChaCha20-Poly1305: registers
pkg/algos/algos.go