Crates.io | tpm-box |
lib.rs | tpm-box |
version | 0.1.1 |
source | src |
created_at | 2024-02-12 12:23:37.598767 |
updated_at | 2024-02-22 13:28:53.082324 |
description | Temporary secret encryption using TPM |
homepage | |
repository | https://github.com/wiktor-k/tpm-box |
max_upload_size | |
id | 1136866 |
size | 76,195 |
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
.
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.
This project is licensed under either of:
at your option.
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.