Zeroization in practice: clearing secrets from stack and registers

jedisct1 · x · 2026-10-08

Frank Denis continues his series on zeroization: code meant to wipe secrets can end up creating extra copies.

Key approach: Use a compiler designed for secret protection, e.g. Jasmin—a high-level assembler that proves secret-tagged values are never returned publicly, run in constant time, resist certain Spectre attacks, prove memory safety, and automatically wipe all secret values before function return. The fastest AEGIS implementations are written in Jasmin.

For common languages: Instead of micro-level clearing, define boundaries—use ephemeral keys within a clear boundary and retire them once done.

Original post →

More from Safety

Safety channel →