COURSE / REAL PRACTICE
Cryptography for application developers
Use standard Go primitives to distinguish byte encodings, checksums, authentication, authenticated encryption and password-storage requirements.
Read the explanation and diagrams, then work through the practice. Your browser profile supplies your saved progress.
What you’ll work toward
Build and test a tamper-evident record signer/verifier with standard-library HMAC, explicit context/framing, canonical encodings and a working local CLI. Practise authenticated encryption with Go’s random-nonce AES-GCM API and distinguish password metadata policy from ordinary hashing.
Read an explanation, inspect the diagrams and work through the available checks, debugging exercises and builds. Feedback and prerequisite links guide the next step.
Before you start
This course builds on these skills:
- Packages, modules & contract tests
- Errors as values & useful context
- Trust boundaries, validation & output contexts
Individual lessons can add prerequisites. Your lesson progress shows your actual readiness.
A look inside the first lesson
Choose the security goal before the primitive
package main
import ("fmt";"encoding/base64")
func main(){
message:=[]byte("amount=10");encoded:=base64.StdEncoding.EncodeToString(message);decoded,_:=base64.StdEncoding.DecodeString(encoded);fmt.Println(string(decoded))
}Your lesson sequence
Follow the same units and lessons in either view. Prerequisite links and your practice progress stay with each lesson.
Goals, bytes and ordinary hashes
- LESSON 01.01
Choose the security goal before the primitive
Separate reversible representation, unkeyed checksums, shared-key authentication and authenticated confidentiality.
Open lesson - LESSON 01.02
Round-trip bytes through canonical hex and Base64
Preserve arbitrary bytes, reject malformed or alternate spellings and keep encoding separate from security guarantees.
Open lesson - LESSON 01.03
Use a checksum without mistaking it for authentication
Calculate the complete SHA-256 digest and distinguish a trusted expected checksum from an attacker-supplied replacement.
Open lesson
Authentication, encryption and password policy
- LESSON 02.01
Authenticate exact bytes with HMAC
Use HMAC-SHA-256 and hmac.Equal, verify published vectors and reject changed messages, wrong keys and truncated tags.
Open lesson - LESSON 02.02
Use authenticated encryption with managed nonces
Open AES-256-GCM records with Go’s random-nonce wrapper, bind associated data and return no plaintext when authentication fails.
Open lesson - LESSON 02.03
Separate password-storage requirements from fast hashing
Validate two explicit bounded metadata profiles while recognizing that metadata checks are neither a KDF nor password verification.
Open lesson