Skip to content

Temporary secret encryption using TPM

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

wiktor-k/tpm-box

Repository files navigation

TPM Box

CI Crates.io

Encrypts data to a ephemeral symmetric key that is stored in the TPM.

This way the application can store and give others encrypted blobs that can be decrypted only by the same instance of the TpmBox.

Example

Sealing the data and then unsealing it using the same in-memory object:

let mut data = tpm_box::TpmBox::new("mssim:").unwrap();

let plaintext = vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16];

let ciphertext = data.encrypt(&plaintext).unwrap();
let unsealed = data.decrypt(&ciphertext).unwrap();

assert_eq!(plaintext, unsealed.as_ref());

For hardware TPMs a TCTI such as device:/dev/tpmrm0 is appropriate.

License

This project is licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Temporary secret encryption using TPM

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Contributors