street_cred/lib.rs
1//! Manage encrypted secrets for your applications.
2//!
3//! street-cred provides the means to encrypt/decrypt files and data through both a cli
4//! tool and as a library.
5//!
6//! # Quickstart (CLI)
7//!
8//! Navigate to a directory where you'd like to have encrypted secrets stored and
9//! use the following command to generate an encrypted secrets file.
10//!
11//! ``` sh
12//! street-cred init
13//! ```
14//!
15//! This will create two files for you. The first is `credentials.yml.enc`, which stores your
16//! secrets encrypted. You can safely rename this file as needed. The second file generated is
17//! your `master.key`. This is your encryption key, protect it like a password!
18//!
19//! To edit your encrypted secrets, use the following command.
20//!
21//! ```sh
22//! street-cred edit credentials.yml.enc
23//! ```
24//!
25//! This should open your secrets file unecrypted in your EDITOR. If you don't have an editor
26//! set, it will default to vim for editing your secrets. Upon saving and closing your editor,
27//! the contents of your file will be re-encrypted using your encryption key and written out
28//! to disk.
29//!
30//! # Quickstart (Library)
31//!
32//! In order to use street-cred as a library in your own code, you'll need to add street-cred to
33//! your dependencies in Cargo.toml. You can quickly accomplish this by running the following command.
34//!
35//! ```sh
36//! cargo add street-cred
37//! ```
38//!
39//! Once you've added the crate to your project, you can import various parts of it to start encrypting
40//! your data.
41//!
42//! Encrypting/Decrypting files can be accomplished with [FileEncryption].
43//!
44//! Encrypting/Decrypting data directly can be accomplished using [MessageEncryption]. While using
45//! MessageEncryption, you'll need to provide some data for the encryption process like the
46//! encryption key and additional authenticated data. street-cred provides a few utility functions for this
47//! data via [CipherGeneration].
48//!
49
50mod encryption;
51mod serialization;
52
53pub use crate::encryption::{CipherGeneration, FileEncryption, MessageEncryption};
54pub use crate::serialization::RubyMarshal;