From 62b749744c6e0c2718f8c3db825698edabdcfebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Wed, 14 Feb 2024 18:16:45 +0100 Subject: [PATCH] First commit --- .gitignore | 7 +++++++ Cargo.toml | 18 ++++++++++++++++++ README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ rustfmt.toml | 1 + src/lib.rs | 14 ++++++++++++++ 5 files changed, 82 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 README.md create mode 100644 rustfmt.toml create mode 100644 src/lib.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..86f1aca --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +Cargo.lock +target/ +*~ +\#* +.\#* +*.swp +TODO.md diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..630049f --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "coffio" +version = "0.1.0" +authors = ["Rodolphe Breard "] +edition = "2021" +description = "" +documentation = "https://docs.rs/coffio/" +readme = "README.md" +repository = "https://github.com/breard-r/libreauth" +license = "MIT OR Apache-2.0" +keywords = ["cryptography", "encryption"] +categories = ["cryptography"] + +[features] +default = [] +hazardous-materials = [] + +[dependencies] diff --git a/README.md b/README.md new file mode 100644 index 0000000..337877b --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ + +[//]: # (Copyright 2019-2020 Rodolphe Bréard ) + +[//]: # (Copying and distribution of this file, with or without modification,) +[//]: # (are permitted in any medium without royalty provided the copyright) +[//]: # (notice and this notice are preserved. This file is offered as-is,) +[//]: # (without any warranty.) + + +# Coffio + +![License MIT OR Apache 2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue) + +Abstraction layer for symmetric data encryption, primarily designed for database column encryption. + + +# Disclaimer + +:warning: DANGER: DRAGONS A(H)EAD! :dragon_face: + +This crate is experimental and has never been audited by an independent security professional. You should therefore NOT use it in production. + +Although this crate aim to reduce the risk of misuse, it is still possible to use it in such a way that the cryptography it uses does not provides all the security guaranties you need. Ask your cryptographer if this crate is relevant to your use case and if you are using it correctly. + + +# Frequently Asked Questions + +## Should I use this project? + +Not yet. + +## Why shouldn't I directly use a symmetric encryption function instead of this crate? + +Cryptography is hard and, even if you some knowledge about it and pay attention, you may misuse it. + +## Why is the context so important? + +It helps preventing a confused deputy attack. + +## Where does the name coffio comes from? + +It is a french slang for a safe or a strongbox. See [coffio](https://fr.wiktionary.org/wiki/coffio) on the french Wiktionary. diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..218e203 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +hard_tabs = true diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}