Registry / crypto / zeroize

zeroize

JSON →
library1.9.0rscratesunverified

Securely clear secrets from memory with a simple trait that guarantees memory is zeroed and not optimized away.

# Cargo.toml [dependencies] zeroize = "1.9.0"
INSTALL
IMPORT
SIG · ZEROIZE
Z
zeroize
cryptorustv1.9.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Zeroize
use zeroize::Zeroize;

Zero out a Vec<u8> securely using the Zeroize trait.

use zeroize::Zeroize; fn main() { let mut secret = vec![1u8, 2, 3, 4]; secret.zeroize(); println!("Secret cleared: {:?}", secret); }
Debug
Known issues
gotchaZeroize does not work on types that implement Drop or contain references; use ZeroizeOnDrop for automatic clearing.
fix
Derive ZeroizeOnDrop for structs that should auto-clear on drop.
affects: >=1.0.0
Upgrade
Version history
1.9.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
38 hits · last 30 days
node
34
Resources
zeroize — cargo add zeroize · libregistry