aprismatic / elgamal Goto Github PK
View Code? Open in Web Editor NEWExtension for the .NET Framework cryptography subsystem, which introduces the ElGamal public key cryptosystem with support for homomorphic multiplication.
Extension for the .NET Framework cryptography subsystem, which introduces the ElGamal public key cryptosystem with support for homomorphic multiplication.
The class ElGamalManaged
has methods
public override byte[] EncryptData(byte[] p_data);
public override byte[] DecryptData(byte[] p_data);
The task is to add the following methods
public byte[] EncryptData(BigInteger p_data);
public BigInteger DecryptData(byte[] p_data);
as well as the required methods down the line, and cut all the additional work on creating BigIntegers from byte arrays and exporting BigIntegers to byte arrays.
Right now the implementation uses the System.Random
random number generator, which is against all rules of cryptography. Needs to be switched over to using System.Security.Cryptography.RNGCryptoServiceProvider
.
Switch this library to use System.Numerics.BigInteger
instead of our own implementation of big integer arithmetics—BigInteger
.
o_random
in ElGamalEncryptor
is IDisposable
and therefore should be disposed. I suggest adding Dispose
method to ElGamalEncryptor
and making it IDisposable
, and do a using (...) {...}
in ElGamalManaged.EncryptData
(and everywhere else ElGamalEncryptor
is used too, if any).
@cheeyixu please fix!
It appears as a problem this part of code due to not recognizing ModInverse as a function.
Class: ElGamalDecryptor.cs
Line: A = A.ModInverse(KeyStruct.P);
Issue: ModInverse.
Any idea how to make it work ?
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.