#encryption #data #hook #persist

encrypted

A type wrapper for encrypted data with hooks to persist it

1 unstable release

0.0.0 Apr 3, 2020

#13 in #persist

GPL-3.0-or-later

3KB

                    +---------------------+
                    |                     |
                    |      Encrypted      |
                    |                     |
                    +---------------------+

A wrapper for encrypted data in your program. "Open" data in-place with pluggable encryption backends. This crate is currently empty and will be filled soon!

 use encrypted::{Encrypter, Encrypted, DetachedKey};
 
 impl Encrypter for MyKeyType { ... }
 impl Detachedkey for MyKeyType {}

 fn main() {
     let key: Arc<_> = // ... create your encryption key
     let mut e = Encrypted::new("Hello!".to_string());
     e.close(Arc::clone(&key)).unwrap();

     // Now `e` is encrypted
     assert_eq!(e.encrypted(), true);
 }

No runtime deps