From 98687ed0454061c7164ab64e8bd5d25b18896a39 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Sat, 27 Jul 2019 01:39:50 +0200 Subject: [PATCH] Decode from base64 --- Cargo.lock | 1 + Cargo.toml | 3 ++- src/crypto.rs | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) 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() } -- 2.45.2