* PS> cd vcpkg\r
* PS> .\bootstrap-vcpkg.bat\r
* Install openssl dev livb\r
- * PS> vcpkg install openssl:x64-windows\r
+ * PS> .\vcpkg.exe install openssl:x64-windows\r
* Define these env variables:\r
* $env:VCPKG_ROOT=<path to vcpkg installation>\r
* $env:OPENSSL_DIR=<path to vcpkg installation>\installed\x64-windows\r
}\r
\r
/// Encrypt the given text with the given key. The key length must be 128 bits encoded in base64.\r
-/// Ouput format:\r
-/// Format "1" + base_64(<IV> + <hash(message)> + <aes(message)>)\r
+/// Ouput format: "1" + base_64(<IV> + <hash(message)> + <aes(message)>)\r
/// IV: 16 bytes randomized.\r
/// Mode : CBC.\r
pub fn encrypt(key: &str, plain_text: &str) -> Result<String, EncryptError> {\r
Ok(String::from("1") + &base64::encode(&result))\r
}\r
\r
-/// TODO: return a Result<string, DecryptError>\r
+/// Decrypt the given text with the given key. The key length must be 128 bits encoded in base64.\r
+/// Input format: "1" + base_64(<IV> + <hash(message)> + <aes(message)>)\r
pub fn decrypt(key: &str, cipher_text: &str) -> Result<String, DecryptError> {\r
let key_as_bytes = decode_key(key).map_err(|e| DecryptError::KeyError(e))?;\r
\r