#secret-management #secret #secure #memory #wipe #memory-safe

no-std secrecy

Wrapper types and traits for secret management which help ensure they aren't accidentally copied, logged, or otherwise exposed (as much as possible), and also ensure secrets are securely wiped from memory when dropped

20 releases (10 breaking)

0.10.3 Oct 9, 2024
0.9.0-pre.0 Jul 30, 2024
0.8.0 Jul 18, 2021
0.7.0 Jul 8, 2020
0.0.0 Oct 4, 2018

#24 in Cryptography

Download history 427955/week @ 2024-08-21 409107/week @ 2024-08-28 440676/week @ 2024-09-04 425270/week @ 2024-09-11 414419/week @ 2024-09-18 440998/week @ 2024-09-25 461758/week @ 2024-10-02 462041/week @ 2024-10-09 493129/week @ 2024-10-16 495887/week @ 2024-10-23 480795/week @ 2024-10-30 496992/week @ 2024-11-06 625022/week @ 2024-11-13 545428/week @ 2024-11-20 420687/week @ 2024-11-27 439286/week @ 2024-12-04

2,128,545 downloads per month
Used in 1,836 crates (243 directly)

Apache-2.0 OR MIT

16KB
204 lines

secrecy.rs 🤐 iqlusion

Crate Docs Apache 2.0/MIT Licensed MSRV Safety Dance Build Status

A simple secret-keeping library for Rust.

Documentation

About

secrecy is a simple, safe (i.e. forbid(unsafe_code) library which provides wrapper types and traits for secret management in Rust, namely the Secret<T> type for wrapping another value in a "secret cell" which attempts to limit exposure (only available through a special ExposeSecret trait).

This helps to ensure secrets aren't accidentally copied, logged, or otherwise exposed (as much as possible), and also ensures secrets are securely wiped from memory when dropped.

Minimum Supported Rust Version

Rust 1.60 or newer.

In the future, we reserve the right to change MSRV (i.e. MSRV is out-of-scope for this crate's SemVer guarantees), however when we do it will be accompanied by a minor version bump.

serde support

Optional serde support for parsing owned secret values is available, gated under the serde cargo feature.

It uses the Deserialize and DeserializeOwned traits to implement deserializing secret types which also impl these traits.

This doesn't guarantee serde (or code providing input to serde) won't accidentally make additional copies of the secret, but does the best it can with what it is given and tries to minimize risk of exposure as much as possible.

License

Copyright © 2019-2024 iqlusion

secrecy is distributed under the terms of either the MIT license or the Apache License (Version 2.0), at your option.

See LICENSE (Apache License, Version 2.0) file in the iqlusioninc/crates toplevel directory of this repository or LICENSE-MIT for details.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~190KB