Skip to content

KostasAronis/OrderPreservingEncryptionDotNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OrderPreservingEncryptionDotNet

OrderPreservingEncryptionDotNet is a dotnet core implementation of Boldyreva symmetric order-preserving encryption scheme Boldyreva's paper.

Installation

Nuget package url

Package-Manager Console

Install-Package OrderPreservingEncryptionDotNet  

.net CLI

dotnet add package OrderPreservingEncryptionDotNet

Usage

using OrderPreservingEncryptionDotNet;

{...}

private byte[] key = OPE.CreateKey(32);
private OPE ope = new OPE(key);
var n1 = 1000;
var n2 = 1100;
var n1Encrypted = ope.Encrypt(n1);
var n2Encrypted = ope.Encrypt(n2);

if(n1Encrypted < n2Encrypted)
{
  Console.WriteLine("It works");
}
else
{
  throw new Exception(":-( Write me up an issue please.");
}

var n1Decrypted = ope.Decrypt(n1Encrypted);
var n2Decrypted = ope.Decrypt(n2Encrypted);

if( n1Decrypted != n1 || n2Decrypted != n2)
{
  throw new Exception(":-( Write me up an issue please.");
}

Contributing

Issues are welcome. Pull requests are more than welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GNU GENERAL PUBLIC LICENSE

Dependencies

Bouncy Castle

About

.Net core symmetric order-preserving encryption scheme for integers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages