How golang/crypto works
Go Cryptography is a collection of supplementary cryptographic primitives, protocol implementations, certificate tooling, and secure transport libraries. The principal workflow is: an application invokes a package API, the package parses or exchanges protocol data, applies cryptographic operations, and returns authenticated messages, keys, sessions, certificates, or trust roots. Major independent branches include SSH, ACME, OpenPGP, OTR, password/key derivation, AEAD/signatures, and certificate-root handling. The graph reflects the tree, README, and sampled source; unsampled package relationships are intentionally omitted.
Main entry points: ssh/client.go SSH Client · acme.go ACME Client · server.go SSH Server · agent/client.go Agent Client
Components 25
Security Protocols
- SSH Client
ssh/client.go - SSH Authentication
ssh/client_auth.go - SSH Server
ssh/server.go - Agent Client
ssh/agent/client.go - Agent Server
ssh/agent/server.go - ACME Client
acme/acme.go - OTR Conversation
otr/otr.go - OpenPGP API
openpgp/read.go
Cryptographic Primitives
- Argon2 Derivation
argon2/argon2.go - ChaCha20-Poly1305
chacha20poly1305/chacha20poly1305.go - Ed25519 Signatures
ed25519/ed25519.go - Curve25519 Exchange
curve25519/curve25519.go - NaCl Authentication
nacl/auth/auth.go - HKDF Derivation
hkdf/hkdf.go
Encoding Layers
- Cryptographic Bytes
cryptobyte/string.go - OpenPGP Packets
openpgp/packet/packet.go
Certificate Trust
- NSS Root Parser
x509roots/nss/parser.go - Fallback Roots
x509roots/fallback/fallback.go - Certificate Results
acme/types.go - Trusted Roots
x509roots/fallback/bundle/roots.go
Other components
- Application
- SSH Peer
- ACME CA
- SSH Agent
- NSS Certdata
Connections 26
- Application → SSH Client: opens connection
- SSH Client → SSH Authentication: authenticates
- SSH Client → SSH Peer: exchanges SSH
- Application → SSH Server: accepts connection
- SSH Server → SSH Peer: serves SSH
- Application → Agent Client: requests signatures
- Agent Client → SSH Agent: sends RPC
- SSH Agent → Agent Server: uses protocol
- Application → ACME Client: manages certificates
- ACME Client → ACME CA: requests issuance
- ACME Client → Certificate Results: returns certificates
- Application → OTR Conversation: starts conversation
- OTR Conversation → SSH Peer: exchanges messages
- Application → OpenPGP API: reads or writes
- OpenPGP API → OpenPGP Packets: encodes packets
- Application → Argon2 Derivation: derives password keys
- Application → ChaCha20-Poly1305: seals messages
- Application → Ed25519 Signatures: signs messages
- Application → Curve25519 Exchange: establishes shared keys
- Application → NaCl Authentication: authenticates messages
- Application → HKDF Derivation: derives keys
- Application → Cryptographic Bytes: parses byte data
- NSS Certdata → NSS Root Parser: parses roots
- NSS Root Parser → Trusted Roots: returns trusted roots
- Application → Fallback Roots: sets fallback roots
- Fallback Roots → Trusted Roots: installs roots