From dc642430468a1942246642775040f9784ca3e8f2 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Fri, 16 Jun 2017 21:27:31 -0400 Subject: Basic encryption and password validation. This is a placeholder encryption scheme for authentication. --- src/bin/crypto.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/bin') diff --git a/src/bin/crypto.rs b/src/bin/crypto.rs index e059663..5cc8549 100644 --- a/src/bin/crypto.rs +++ b/src/bin/crypto.rs @@ -1,4 +1,5 @@ extern crate crypto; +extern crate systemhttp; use crypto::bcrypt_pbkdf::bcrypt_pbkdf; @@ -7,12 +8,14 @@ pub fn encode(pw: &str) -> Vec { let mut out = vec!(0; 32); let encrypted = bcrypt_pbkdf( pw.as_bytes(), salt.as_bytes(), - 100, &mut out); + 10, &mut out); out } pub fn main() { let pw = "123"; let out = encode(pw); + let out2 = systemhttp::auth::encode(pw); println!("{}: {:?}", pw, out); + println!("{}: {:?}", pw, out2); } -- cgit v1.2.3