~cyborg/crypt

d0313ab66246d36a90c883dfa994ccba340ddfb3 — christian-cleberg 2 months ago 0d2c6fa
update dependencies and clean up code
4 files changed, 10 insertions(+), 7 deletions(-)

M Cargo.lock
M Cargo.toml
M README.md
M src/main.rs
M Cargo.lock => Cargo.lock +1 -0
@@ 129,6 129,7 @@ dependencies = [
 "clap",
 "cli-table",
 "fernet",
 "openssl",
 "rand",
 "rusqlite",
 "uuid",

M Cargo.toml => Cargo.toml +1 -0
@@ 19,4 19,5 @@ uuid = { version = "0.8", features = ["v4"] }
rand = "0.8.4"
rusqlite = "0.25.3"
cli-table = "0.4"
openssl = ">=0.10.9"
fernet = "0.1"
\ No newline at end of file

M README.md => README.md +3 -1
@@ 1,8 1,10 @@
# Crypt: A Password Manager

A simple command-line password manager, written in Rust. This tool allows you to manage accounts and generate random
A simple command-line password manager, written in Rust + SQLite. This tool allows you to manage accounts and generate random
passwords containing ASCII letters, numbers, and punctuation or XKCD-like passphrases.

Data is encrypted prior to being saved within the SQLite database using 

---

**NOTE:** This crate is not ready for use in production yet. There are many items still left to implement prior to a

M src/main.rs => src/main.rs +5 -6
@@ 1,9 1,8 @@
use clap::{Arg, App, SubCommand};
use cli_table::{format::Justify, print_stdout, Cell, Style, Table};
use fernet::Fernet;
use rand::{thread_rng, Rng, distributions::{Alphanumeric, Uniform, Standard}, seq::IteratorRandom, RngCore, CryptoRng};
use clap::{Arg, App};
use cli_table::{print_stdout, Cell, Style, Table};
use rand::{thread_rng, Rng};
use rusqlite::{Connection, Result};
use std::{fs, io::{self, Read, BufRead, BufReader}, str};
use std::{fs, str};
use uuid::Uuid;

pub const SQLITE_DB: &str = "vault.sqlite";


@@ 72,7 71,7 @@ fn generate_passphrase(n: u32, passphrase_symbol: String) -> String {
    // Get random words
    let len = words.len();
    let mut rng = thread_rng();
    let mut password_words: Vec<&str> = (0..n)
    let password_words: Vec<&str> = (0..n)
        .map(|_| words[(rng.gen::<usize>() % len) - 1])
        .collect();