created_at2023-10-13 04:52:27.714158
updated_at2023-10-13 04:52:27.714158
descriptionOPE (order preserving encryption) algorithms for liserk zero knowledge database
Neel Chauhan (neelchauhan)



Order-Preserving Encryption (OPE) Project


This project is a Rust implementation of Order-Preserving Encryption (OPE). OPE is a cryptographic technique for encrypting ordered data in such a way that the order is preserved under encryption. This enables range queries and other order-based operations to be performed on the encrypted data without requiring decryption first.


  • Implements OPE algorithms to encrypt and decrypt data while preserving order.
  • Allows range queries on encrypted data.
  • Provides a command-line interface for easy interaction with the library.
  • Secure and efficient, with minimal overhead.
  • Well-documented codebase for better understanding and contribution.


  • Rust (latest stable version)
  • Cargo (comes with Rust)


cargo add ope-simplified


As a Library

Include this crate in your Rust project by adding the following in your Cargo.toml:

ope-simplified: "0.1.0"

Then you can use the OPE library in your code like this:

use ope_simplified::*;

fn main() {
    let key = b"test_key";
    let ope = Ope::new(key, 0, 20).unwrap();

    let plaintext = 5;
    let ciphertext = ope.encrypt(plaintext).unwrap();

    let decrypted = ope.decrypt(ciphertext).unwrap();
    assert_eq!(plaintext, decrypted);

Research Acknowledgements

This project owes its existence to the groundbreaking research in the field of Order-Preserving Encryption (OPE). Notably, we would like to mention the seminal paper "Order-Preserving Symmetric Encryption" by Boldyreva, Chenette, Lee, and O’Neill, which laid the foundation for practical OPE schemes. This paper, published in 2009, thoroughly examined the security properties and use cases for OPE and has since been a cornerstone for subsequent developments in this field. Another critical work is "Practical Order-Revealing Encryption with Limited Leakage" by Chenette, Lewi, Weis, and Wu, which offers a different approach to OPE that minimizes leakage. Their contributions have been invaluable to the cryptographic community and have directly inspired the algorithms and methodologies implemented in this project. We would also like to acknowledge various other papers and research articles that have collectively contributed to the advancement of OPE techniques. Through their rigorous research, they have made it possible to handle ordered data securely and efficiently.


Contributions to this project are welcome. If you find a bug or think of a new feature, please create an issue. If you would like to contribute code, please fork the repository and submit a pull request.


This project is licensed under the MIT License - see the LICENSE file for details.


This project is developed and maintained by contributors who are passionate about security and cryptography. Special thanks to everyone who has contributed to making this project possible.

This project is based on mathematical https://eprint.iacr.org/2012/624.pdf

Commit count: 147

cargo fmt