Skip to content

ticki/secbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SecBox -- Sensitive data container.

I found myself reimplementing this piece in different projects, so I decided to make it a library.

secbox provides a primitive which tries to harden protection of the inner data, preventing certain attack vectors. It can be used as building block to primitives like SecStr.

The docs detail the methods used.

This is useful for storing sensitive data like passwords and private keys.

Cargo.toml

secbox = "0.1"

Example

// We box the vector, despite only being a container. Techinically, this is
// unnecessary, but it improves the security slightly.
let mut pass = SecBox::new(Vec::new());

for i in ::std::io::stdin().chars() {
    match i {
        // Stop on enter.
        '\n' => break,
        // We SecBox it and the push it. SecBoxing it here will protect the
        // data through a variety of measures.
        i => pass.push(SecBox::new(i)),
    }
}

About

SecBox - Sensitive data container

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages