Giter Site home page Giter Site logo

cipherstash / ore.rs Goto Github PK

View Code? Open in Web Editor NEW
18.0 9.0 0.0 570 KB

Order-revealing encryption library used by the CipherStash searchable encryption platform.

Home Page: https://cipherstash.com

License: Other

Rust 100.00%
encryption security searchable-encryption cryptography rust

ore.rs's People

Contributors

auxesis avatar bennetthardwick avatar coderdan avatar dominikwilkowski avatar freshtonic avatar ragibkl avatar tobyhede avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ore.rs's Issues

is there any api for serde?

like I need to send the ciphertext to somewhere else, hopefully via http, so I wish the ciphertext to be json serializable and de serializable.
is there any way to do this?

Comparison when only one left ciphertext present intermittently fails

When running with this additional quickcheck:

diff --git a/src/scheme/bit2.rs b/src/scheme/bit2.rs
index db83900..4e6380e 100644
--- a/src/scheme/bit2.rs
+++ b/src/scheme/bit2.rs
@@ -327,6 +327,20 @@ mod tests {
             }
         }
 
+        fn compare_u64_single_left(x: u64, y: u64) -> bool {
+            let ore = init_ore();
+            let a = x.encrypt(&ore).unwrap();
+            let mut b = y.encrypt(&ore).unwrap();
+
+            b.left = Left::<ORE, 8>{ f: [Default::default(); 8], xt: [0; 8] };
+
+            match a.cmp(&b) {
+                Ordering::Greater => x > y,
+                Ordering::Less    => x <= y,
+                Ordering::Equal   => panic!("Can't happen"),
+            }
+        }
+
         fn compare_u64_raw_slices(x: u64, y: u64) -> bool {
             let ore = init_ore();
             let a = x.encrypt(&ore).unwrap().to_bytes();

around one in four test suite runs fail on this test.

Forming a lexicographically ordered list of encrypted values

I'm so glad you guys are working on this! Looks great! I'm struggling with a question regarding the lexicographical ordering of encrypted values to which you might have an answer.

Suppose you are adding values in a structure that automatically orders them in a lexicographical fashion. Think of b-tree indexed structure or something.

ADD "b"
ADD "a"
ADD "d"
ADD "c"

Iterating through such list would return an ordered array like this:

["a", "b", "c", "d"]

Now, let's repeat these steps but this time ADD ORE encrypted values. This new list won't be ordered anymore. We can sort it by scrolling through the list and compare each entry. Obviously, this solution won't work for long lists or database indexes where you'd like to just stream data without any processing.

I wonder is there a way to generate ORE encoded values in a way that their byte-representations would still form an ordered list? I believe that just computing a "comparing" of left and right part of the ORE encrypted value won't do the trick. Also, I think that the left part should not even be stored in the database, right?

I'd appreciate any suggestion on this. Thank you.

ORECipher.new() seed parameter is underspecified

It would be handy to know what the required properties of the seed parameter to ORECipher.new() are, in order to safely use it. Does it need to be random, is it considered a secret, does it need to be protected against reuse -- either with the same key(s) or across different key(s)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.