From: Greg Burri Date: Fri, 26 Jul 2019 23:39:50 +0000 (+0200) Subject: Decode from base64 X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=98687ed0454061c7164ab64e8bd5d25b18896a39;p=rup.git Decode from base64 --- diff --git a/Cargo.lock b/Cargo.lock index f16cc63..25b9796 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1290,6 +1290,7 @@ dependencies = [ "actix-files 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "actix-web 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "askama 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "listenfd 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.10.23 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 0b617e5..aee6a09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,4 +15,5 @@ openssl = "0.10" listenfd = "0.3" # To watch file modifications and automatically launch a build process (only used in dev/debug). ron = "0.5.1" # Rust object notation, to load configuration files. itertools = "0.8.0" -url = "1.7.2" \ No newline at end of file +url = "1.7.2" +base64 = "0.10.1" \ No newline at end of file diff --git a/src/crypto.rs b/src/crypto.rs index 3a83d8c..6d791eb 100644 --- a/src/crypto.rs +++ b/src/crypto.rs @@ -1,8 +1,9 @@ +pub fn encrypt(key: &str, plain_text: &str) -> String { + let key_as_bytes = base64::decode(key); + -pub fn encrypt(key: &str, plain_text: &str) -> String { - dbg!(key); String::new() }