Releases: hardbyte/Paillier.jl
v0.3.1
v0.3.0
v0.3.0-a.2
Introduces a breaking change in the encoded type, which should allow easier composition with other Julia modules.
To migrate replace Encoding(Float32, publickey)
with Encoding{Float32}(publickey)
.
v0.3.0-alpha
Introduces a breaking change in the encoded type, which should allow easier composition with other Julia modules.
To migrate replace Encoding(Float32, publickey)
with Encoding{Float32}(publickey)
.
Alpha release for testing
v0.2.4
v0.2.3
v0.2.2
Now efficiently supporting arrays of encrypted floating point numbers.
julia> publickey, privatekey = generate_paillier_keypair(2048)
julia> a = [0.0, 1.2e3, 3.14, π]
julia> encoding = Encoding(Float32, publickey)
julia> enca = encode_and_encrypt(a, encoding);
julia> decrypt_and_decode(privatekey, enca)
4-element Array{Float32,1}:
0.0
1200.0
3.1399999
3.1415927
julia> encb = 2 * enca;
julia> decrypt_and_decode(privatekey, encb)
4-element Array{Float32,1}:
0.0
2400.0
6.2799997
6.2831855
julia> decrypt_and_decode(privatekey, reduce(+, encb))
2412.5632f0
v0.2.1
Support multiplication of EncryptedNumbers
.
Other minor changes:
- Better representation of public keys. e.g.
PublicKey(bits=1024, hash=12389180309762011382)
- More documentation around encoding.
- Working on handling corner cases for encoding large numbers into a small cipherspace etc.
v0.2.0
New features
Added an encoding system that supports julia's floating point types:
julia> keysize = 2048
julia> publickey, privatekey = generate_paillier_keypair(keysize)
julia> encoding = Encoding(Float32, publickey)
julia> a = Float32(π)
julia> b = 100
julia> enc1 = encode_and_encrypt(a, encoding)
julia> decrypt_and_decode(privatekey, enc1)
3.1415927f0
julia> enc1.exponent
-6
julia> enc2 = encode_and_encrypt(b, encoding)
julia> enc3 = decrypt_and_decode(privatekey, enc1 + enc2)
julia> enc3
103.141594f0
julia> decrypt_and_decode(privatekey, enc1 - 20.0)
-16.858408f0
The raw cryptosystem has had some modifications too.
- Keys are now represented on the command line nicer.
- Almost everything has been documented.
Known issues/TODO
- Still need to add support for multiplication of encoded numbers.
- The EncryptedArrays still all work but don't help with encoded numbers yet.
First cut - v0.1.1
WARNING
First very rough release - Don't use for anything serious yet! Not reviewed by a cryptographer.
In particular note that I don't obfuscate the results of encrypted math operations by default. This is an
optimization copied from python-paillier, however after any homomorphic operation - before sharing an EncryptedNumber
or EncryptedArray
you must call obfuscate()
to secure the ciphertext.
Ideally this will occur behind the scenes at serialization time.
Quick Example
julia> using Paillier
julia> pub, priv = generate_paillier_keypair(1024)
julia> a = encrypt(pub, 10)
julia> b = encrypt(pub, 50)
julia> decrypt(priv, a)
10
julia> decrypt(priv, a + 5)
15
julia> # obfuscate before sharing an encrypted number:
julia> c = obfuscate(2a + b);
julia> typeof(c)
EncryptedNumber
julia> decrypt(priv, c)
70
Array Support
To avoid wasting space having multiple copies of the same PublicKey
I've added an
EncryptedArray
type that shares one public key for an array of ciphertexts.
julia> a = [0,1,2,3,4,5]
julia> enca = encrypt(publickey, a)
julia> encb = 2 * enca
julia> decrypt(privatekey, reduce(+, encb))
30