Open MrT3acher opened 1 year ago
Let's go one by one. In general, information to use Rabe can be found here.
There are many different schemes offered by Rabe: BSW07, KP-ABE FAME, FAME, LW11, YCT14, etc. If you have installed rabe correctly, whenever you use it in a rust script you may have a cargo.toml
looking like this:
[package]
name = "NAME"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rabe = "0.3.1"
[dev-dependencies]
criterion = "0.3"
[[bench]]
name = "SCRIPT_NAME"
harness = false
And below you have an example on how to use BSW, extracted from the documentation
use rabe::schemes::bsw::*;
use rabe::utils::policy::pest::PolicyLanguage;
let (pk, msk) = setup();
let plaintext = String::from("dance like no one's watching, encrypt like everyone is!").into_bytes();
let policy = String::from(r#""A" and "B""#);
let ct_cp: CpAbeCiphertext = encrypt(&pk, &policy, &plaintext, PolicyLanguage::HumanPolicy).unwrap();
let sk: CpAbeSecretKey = keygen(&pk, &msk, &vec!["A".to_string(), "B".to_string()]).unwrap();
assert_eq!(decrypt(&sk, &ct_cp).unwrap(), plaintext);
Regarding its use with python, I'm sorry but I do not know how to create a Python wrapper. However, you may find useful the Python ABE library, Charm.
I had implemented the CFFI and a C# wrapper library for all algorithms in rabe. If you need it to create a wrapper in Python or other languages, please check my repositories (Rabe-ffi).
Thanks! I finally used https://github.com/MrT3acher/mosaic.
Hi I've built the project using
cargo build --release
. Now I seelibrabe.so
file. It contains these symbols (usingnm
command):I don't see any
encrypt
ordecrypt
function. Did I have a mistake in building the project? or is there another way to see the exports of this shared object (so) file.finally I want to use this project in python language.