Repository navigation
Technical Architecture
Aarav Maloo edited this page Jan 7, 2026
·
1 revision
This document covers the internal structure and implementation details of APM.
The APM vault is a binary file with the following structure:
| Offset | Size | Name | Description |
|---|---|---|---|
| 0 | 8B | Magic | "APMVAULT" header. |
| 8 | 1B | Version | Format version (currently 1). |
| 9 | 16B | Salt | Used for Argon2id KDF. |
| 25 | 32B | Validator | HMAC of the master password for verification. |
| 57 | 12B | Nonce | AES-GCM IV. |
| 69 | ... | Ciphertext | AES-GCM encrypted JSON vault data. |
| End - 32 | 32B | HMAC | HMAC-SHA256 signature of the preceding data. |
The project is written in Go and organized as follows:
-
main.go: CLI entry point, command definitions (Cobra), and UI logic. -
src/vault.go: Primary data structures and CRUD operations. -
src/utils.go: Cryptographic primitives, key derivation, and password generation. -
src/portability.go: Serialization and import/export logic (JSON/CSV/TXT). -
src/session.go: Logic for managing temporary unlock sessions.
- Go 1.20+
github.com/spf13/cobragolang.org/x/crypto/argon2github.com/fatih/color
To build the APM binary:
go build -o pm.exeRun the comprehensive test suite to verify cryptographic and logic integrity:
go test -v ./...