#lib #encryption #order-preserving #cryptdb

ope

This is an Order-preserving encryption (OPE) lib inspired by cryptdb's ope implementation

2 releases

0.1.1 Jul 16, 2023
0.1.0 Jul 16, 2023

#1578 in Cryptography

Download history 29/week @ 2024-03-11 17/week @ 2024-03-18 37/week @ 2024-03-25 52/week @ 2024-04-01 21/week @ 2024-04-08 70/week @ 2024-04-15 27/week @ 2024-04-22 13/week @ 2024-04-29 13/week @ 2024-05-06 19/week @ 2024-05-13 16/week @ 2024-05-20 17/week @ 2024-05-27 24/week @ 2024-06-03 17/week @ 2024-06-10 42/week @ 2024-06-17 56/week @ 2024-06-24

139 downloads per month
Used in 6 crates (via sentc-crypto-core)

Custom license

16KB
445 lines

Ope in rust

This is an Order-preserving encryption (OPE) lib inspired by cryptdb's ope implementation.

It is a pure rust implementation, no c dependencies needed.

It is also written for no-std targets (thanks to num-traits) and works in wasm.

The max value to encrypt is 65532

use ope_rs::get_ope;

fn main()
{
	let k = b"this is a key 10".to_owned();

	let ope = get_ope(&k);

	let a = ope.encrypt(21).unwrap();
	let b = ope.encrypt(65531).unwrap();
	let c = ope.encrypt(65532).unwrap();

	assert!(a < b);
	assert!(b < c);
}

Dependencies

~1.5MB
~37K SLoC