Skip to content

Technical Architecture

Aarav Maloo edited this page Jan 7, 2026 · 1 revision

APM Technical Architecture

This document covers the internal structure and implementation details of APM.

1. File Format (v1)

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.

2. Code Organization

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.

3. Development

Prerequisites

  • Go 1.20+
  • github.com/spf13/cobra
  • golang.org/x/crypto/argon2
  • github.com/fatih/color

Build

To build the APM binary:

go build -o pm.exe

Testing

Run the comprehensive test suite to verify cryptographic and logic integrity:

go test -v ./...

Clone this wiki locally