Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make data-transfer related objects serializable. #56

Merged
merged 7 commits into from
Jul 26, 2017
Merged

Conversation

tiantianwdy
Copy link
Contributor

  • Made EncryptedNumber, EncodedNumber, PaillierContext and PaillierPublicKey and PaillierPrivateKey, StandardEncodingScheme to implement Serializable

  • Changed the ciphertext in EncryptedNumber to non-trancient protected final BigInteger ciphertext;

@unzvfu
Copy link

unzvfu commented Jun 1, 2017

Previous related discussion about rejecting the relaxation of access to EncryptedNumber::cipherText here #55.

@unzvfu
Copy link

unzvfu commented Jun 1, 2017

In order to safely serialise an EncryptedNumber you must be certain that it has been "obfuscated" by calling EncryptedNumber::getSafeEncryptedNumber() or EncryptedNumber::obfuscate(). Just adding implements Serializable will not do this. Also keep in mind that the distinction between obfuscated and not-yet-obfuscated EncryptedNumbers is for performance reasons: the obfuscation step is (currently) one of the most expensive parts of the whole system.

@unzvfu
Copy link

unzvfu commented Jun 1, 2017

Also relevant is #3.

Copy link
Member

@maxott maxott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will help to make the library more broadly usable

Copy link
Contributor

@hardbyte hardbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to address issue raised by @mhsiah

@maxott maxott requested a review from hardbyte July 14, 2017 07:13
@unzvfu
Copy link

unzvfu commented Jul 17, 2017

@tiantianwdy Do you really need PaillierPrivateKey to be serialisable? After chatting with @maxott it seems we might be able to avoid making it serialisable (which would be safer) since it's only used in the decrypt method.

@maxott
Copy link
Member

maxott commented Jul 17, 2017

Addressed @mhsiah's concern about serialising PrivateKey. The PrivateKey is no longer serialisable and a new 'decrypt` method has been added to the EncryptedNumber to defer private key production to a potentially different mechanism (such a local Keystore)

@maxott maxott requested a review from unzvfu July 17, 2017 03:47
@gusmith
Copy link
Contributor

gusmith commented Jul 17, 2017

Travis build is failing because java 7 does not have the java.util.function package so the code cannot compile:

[error] /home/travis/build/n1analytics/javallier/src/main/java/com/n1analytics/paillier/EncryptedNumber.java:20: package java.util.function does not exist
[error] import java.util.function.Supplier;

@unzvfu unzvfu merged commit 49ab4a9 into master Jul 26, 2017
@unzvfu unzvfu deleted the serializable branch July 26, 2017 03:16
@unzvfu unzvfu restored the serializable branch July 26, 2017 04:32
unzvfu pushed a commit that referenced this pull request Jul 31, 2017
unzvfu pushed a commit that referenced this pull request Sep 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants