tpm-box

Crates.iotpm-box
lib.rstpm-box
version0.1.1
sourcesrc
created_at2024-02-12 12:23:37.598767
updated_at2024-02-22 13:28:53.082324
descriptionTemporary secret encryption using TPM
homepage
repositoryhttps://github.com/wiktor-k/tpm-box
max_upload_size
id1136866
size76,195
David Runge (dvzrv)

documentation

README

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.

Commit count: 0

cargo fmt