How adakhaddad/mirror_naschiphack works
SeBatt is a secure battery-identity proof of concept: a chip samples voltage and signs readings, while a swap station verifies the battery and its signed history. The repository tree does not contain the documented RTL, so the graph focuses on the available Python protocol model, web demo, and firmware. The web workflow is visible in the HTTP handler and demo excerpts; deeper model and firmware interactions are limited to the supplied excerpts and SOURCE INDEX references.
Main entry points: protocol.py Station verifier · hmac.py HMAC-SHA-256 · gen_vectors.py Vector generator · sebatt_fw.c MicroBlaze firmware
Components 16
Station demo
- HTTP API
web/server.py - Demo simulation
web/demo.py
Authentication model
- Battery prover
model/protocol.py - Station verifier
model/protocol.py - Wire protocol
model/protocol.py
Cryptography and keys
- HMAC-SHA-256
model/hmac.py - SHA-256
model/sha256.py - Ring-oscillator PUF
model/ro_puf.py - Vector generator
model/gen_vectors.py
FPGA firmware
- MicroBlaze firmware
fpga/fw/sebatt_fw.c - UART interface
fpga/fw/sebatt_fw.c
Other components
- Station operator
- Web dashboard
web/static/app.js - FPGA board
- Battery voltage source
- Identity database
Connections 20
- Station operator → Web dashboard: operates
- Web dashboard → HTTP API: sends requests
- HTTP API → Demo simulation: dispatches actions
web/server.py - Demo simulation → HMAC-SHA-256: computes tags
web/demo.py - Battery prover → HMAC-SHA-256: signs samples
model/protocol.py - Station verifier → Identity database: checks identity
model/protocol.py - Station verifier → HMAC-SHA-256: recomputes tags
model/protocol.py - Station verifier → Battery prover: requests authentication
model/protocol.py - Station verifier → Wire protocol: encodes messages
model/protocol.py - Wire protocol → Battery prover: carries requests
model/protocol.py - Wire protocol → Station verifier: carries responses
model/protocol.py - HMAC-SHA-256 → SHA-256: hashes messages
model/hmac.py - Battery prover → Ring-oscillator PUF: derives key
model/protocol.py - Vector generator → SHA-256: uses reference
model/gen_vectors.py - Vector generator → HMAC-SHA-256: uses reference
model/gen_vectors.py - Vector generator → Wire protocol: uses protocol
model/gen_vectors.py - Battery voltage source → MicroBlaze firmware: provides voltage
- MicroBlaze firmware → UART interface: sends and receives
fpga/fw/sebatt_fw.c - MicroBlaze firmware → FPGA board: runs on
- UART interface → Station verifier: communicates