#secret #encryption-decryption #sealed #codec #decode #encode #save

sealed-secrets

A simple Rust lib to encrypt and decrypt secrets using Sealed Secrets

4 releases (2 breaking)

0.2.1 Feb 28, 2024
0.2.0 Feb 28, 2024
0.1.0 Feb 28, 2024
0.0.1 Feb 28, 2024

#1553 in Cryptography

37 downloads per month

GPL-3.0 license

5KB
73 lines

sealed-secrets

codecov

Rust library that handles encoding/decoding secrets


lib.rs:

This module provides functions and traits for saving and loading secrets as strings. It includes implementations for saving and loading secrets using the SecretsManager struct.

Example

use sealed_secrets::{encode, decode};
use std::collections::HashMap;

fn main() {
    let mut map = HashMap::new();
    map.insert("key1".to_string(), "value1".to_string());
    map.insert("key2".to_string(), "value2".to_string());
    let key = "password".to_string();
    let encoded = encode(&map, &key).unwrap();
    println!("{}", encoded);
    let key = "password".to_string();
    let map = decode(&encoded, &key).unwrap();
    println!("{:?}", map);
}

Dependencies

~2.7–4MB
~83K SLoC