Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Add the hybrid cryptosystem support #32

Merged

Conversation

ezimuel
Copy link
Contributor

@ezimuel ezimuel commented Aug 10, 2016

This PR adds the hybrid cryptosystem support (OpenPGP like). It allows also multiple encryptions using a keyrings of public/private keys. This can be useful in multi users scenarios to encrypt data only for specific users.

@ezimuel ezimuel added this to the 3.1.0 milestone Aug 10, 2016
@ezimuel
Copy link
Contributor Author

ezimuel commented Aug 10, 2016

@paragonie-scott do you have time for a quick review? Thanks!

@@ -0,0 +1,119 @@
# Encrypt and decrypt using hybrid cryptosystem

Copy link
Member

Choose a reason for hiding this comment

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

Add a note here along the lines of - Since 3.1.0

@paragonie-scott
Copy link

This looks good. It's essentially what EasyRSA tries to provide.

Since this is a new feature, I'd definitely advise forcing the use of OAEP.

@ezimuel
Copy link
Contributor Author

ezimuel commented Aug 10, 2016

@paragonie-scott thanks for your feedback! You right, I always forget OAEP :)

@@ -0,0 +1,119 @@
# Encrypt and decrypt using hybrid cryptosystem

Hybrid is an encryption mode that uses symmetric and public keys ciphers together.
Copy link
Member

Choose a reason for hiding this comment

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

s/keys/key/

* The data are encrypted using a BlockCipher with a random session key
* that is encrypted using RSA with the public key of the receiver.
* The decryption process retrieves the session key using RSA with the private
* key of the receiver and decrypt the data using the BlockCipher.
Copy link
Member

Choose a reason for hiding this comment

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

s/decrypt/decrypts/

@weierophinney
Copy link
Member

Overall, relatively straight-forward, and the code was mostly easy to follow. Nice feature, @ezimuel !

@ezimuel
Copy link
Contributor Author

ezimuel commented Aug 11, 2016

@paragonie-scott Btw, we already use OAEP as default padding for encryption using RSA, since zend-crypt 2.4.9 as reported in ZF2015-10.

@ezimuel
Copy link
Contributor Author

ezimuel commented Aug 11, 2016

@weierophinney I included all the proposed changes. It's ready to be merged, thanks!

@@ -11,6 +11,7 @@ tmp/
zf-mkdoc-theme/

clover.xml
composer.lock
Copy link
Member

Choose a reason for hiding this comment

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

This should be removed; the travis setup uses the lowest/locked/latest strategy, so the file needs to be present. I'll re-add it on merge.

@weierophinney weierophinney merged commit 066f530 into zendframework:develop Aug 11, 2016
weierophinney added a commit that referenced this pull request Aug 11, 2016
weierophinney added a commit that referenced this pull request Aug 11, 2016
weierophinney added a commit that referenced this pull request Aug 11, 2016
@weierophinney
Copy link
Member

Thanks for the great feature, @ezimuel!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants