tonyo / pyope Goto Github PK
View Code? Open in Web Editor NEWImplementation of Boldyreva's symmetric order-preserving encryption in Python
License: MIT License
Implementation of Boldyreva's symmetric order-preserving encryption in Python
License: MIT License
This works fine:
import numpy.random as numpy_random
numpy_random.hypergeometric(32767, 2147450880, 1073741824)
But this doesn't:
import numpy.random as numpy_random
numpy_random.hypergeometric(262, 16776954, 8388608)
For some reason, encryption process is super-slow when using Python 3.
Original rv.py from Ivan Frohne: http://web.archive.org/web/20010603210413/http://www.frohne.westhost.com/rv11.zip
Will probably fix #3
...when creating ValueRange objects and encrypting values.
c = OPE('asdfasdfasdfvzxc12312321', in_range=ValueRange(0,12312312),
out_range=ValueRange(0,2173912837129837129832))
...yields OverflowError: math range error
from pyope.ope import OPE, ValueRange
cipher = OPE(b'fresh key', in_range=ValueRange(0, 1000000),
out_range=ValueRange(0, 2**31 - 1))
print(cipher.encrypt(926546)) # work
print(cipher.encrypt(926542)) # work
print(cipher.encrypt(926543)) # does not work
print(cipher.encrypt(926544)) # does not work
print(cipher.encrypt(926545)) # does not work
The last 3 lines fail at assert in_size <= out_size
.
I think something in the recursive call might be wrong.
Thanks!
cipher1 = OPE(b'lg' * 2, in_range=ValueRange(0, 256),out_range=ValueRange(0, 9999))(does not work)
assert in_size <= out_size AssertionError
If I want to encrypt 0~255, what is the minimum range of cipher text? Can the range of the ciphertext be debugged in the code?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.