You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Okay, so as noted by David Benjamin poly1305 intentionally isn't separately exposed by OpenSSL. Accordingly, we can't expose it as a standalone MAC, but rather only as part of the RFC 7539 AEAD construct. I've modified the list to reflect this.
Just a note so there isn't any duplication of efforts. I have WIP code going for both scrypt and blake2. I'll open up PRs once the other 1.1.0 stuff (mainly #2826) lands.
I've actually got all the blake2 code sitting around already. The open question is how much of the blake2 API do we want to have locked behind NotImplementedError for now.
I think we shouldn't land anything that depends on 1.1.0 features until
1.1.0 is out and in our CI. Feel free to send all the PRs you want though,
we can use those as the place to discuss the API.
On Sat, Jun 11, 2016 at 12:11 PM, Paul Kehrer [email protected]
wrote:
I've actually got all the blake2 code sitting around already. The open
question is how much of the blake2 API do we want to have locked behind
NotImplementedError for now.
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: D1B3 ADC0 E023 8CA6
Along with ChaCha20+Poly1305, I believe CCM would be a really valuable addition to the project. It would enable python users to cover every cipher suite specified for TLS 1.3.
We've talked a bit in the past about CCM #1141 (comment). The primary issue is the length prefixing requiring you to know the length of your data before encrypting. Our current APIs assume a streaming interface (which was a design mistake for AEAD modes but that's what we have for now). If we build a "one shot" AEAD API (provide entire payload, get back encrypted blob, no streaming) then we can talk about whether CCM should be supported.
Thanks for pointing out the issue. Indeed adding CCM support entails some work more convoluted than I expected. For now, I think that we'd be better off using pycryptodome (a fork from pycrypto), as it provides the AEAD modes we need, among other things. Hopefully we could switch to cryptography for a later release.
This has the virtue of not being exposing unauthenticated plaintext in any situation, so it's generally a superior API to our current streaming API (which only supports AEAD via GCM anyway). We would probably want to update our docs to discourage the use of our streaming interface and steer users toward the AEAD API where possible (and of course Fernet if they can).
Disadvantages
The creation of a new interface that combines cipher + mode (or cipher + MAC in the case of chacha20poly1305) is a shift from our current cipher interface that emphasizes composability.
Additionally, this would be a hazmat API as it has no protection against nonce/iv misuse nor does it specify an output format (unlike Fernet).
CCM would come after. If we implement per-construct AEAD interfaces instead of trying to build a generic one then CCM (hopefully) becomes an easier problem.
I'm going to go ahead and close this issue and open separate ones for ChaCha and CCM (yuck). OCB is off the table until someone provides a use case. refs #3667
I heard good things about OCB, faster than GCM, no patent issue any more for opensource projects.
GCM otoh seems to cause bad feelings for cryptographers, they consider it a fragile construction.
Recently the was some breakage for OCB2 though - but guess this does not affect OCB(1), right?
The use case is just to have a "single pass" AEAD cipher, with HW acceleration in popular cpus, without fragility. Considering it as a candidate for borgbackup.
OCB1 and 3 are not affected by the OCB2 break. OpenSSL implements OCB3. There is no hardware acceleration for OCB outside of the core AES acceleration, although it is a fast and elegant construction in general.
Well, the benchmarks i saw, showed it being significantly faster than GCM.
Also, no bad feelings, so it sounded like a winner.
As the OCB implementation is in openssl, I guess it is not a problem for cryptography or borgbackup and users can still decide whether they want to use it or not.
Considering single-pass, accelerated AEAD modes, there are no other good options, right?
Activity
reaperhulk commentedon Jun 5, 2016
Okay, so as noted by David Benjamin poly1305 intentionally isn't separately exposed by OpenSSL. Accordingly, we can't expose it as a standalone MAC, but rather only as part of the RFC 7539 AEAD construct. I've modified the list to reflect this.
Ayrx commentedon Jun 11, 2016
Just a note so there isn't any duplication of efforts. I have WIP code going for both scrypt and blake2. I'll open up PRs once the other 1.1.0 stuff (mainly #2826) lands.
reaperhulk commentedon Jun 11, 2016
I've actually got all the blake2 code sitting around already. The open question is how much of the blake2 API do we want to have locked behind NotImplementedError for now.
scrypt I'll happily let you take :)
alex commentedon Jun 11, 2016
I think we shouldn't land anything that depends on 1.1.0 features until
1.1.0 is out and in our CI. Feel free to send all the PRs you want though,
we can use those as the place to discuss the API.
On Sat, Jun 11, 2016 at 12:11 PM, Paul Kehrer [email protected]
wrote:
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: D1B3 ADC0 E023 8CA6
Ayrx commentedon Jun 11, 2016
@reaperhulk Ah cool. :)
@alex Yeah, no arguments there.
ria4 commentedon Aug 16, 2016
Is there any plan to add support for CCM encryption mode?
I've been working on a TLS implementation for scapy (https://github.com/secdev/scapy). Up to now I've been using pycrypto, which offers CCM support but only when building out of the source repository. And we're planning on switching to cryptography.
Along with ChaCha20+Poly1305, I believe CCM would be a really valuable addition to the project. It would enable python users to cover every cipher suite specified for TLS 1.3.
reaperhulk commentedon Aug 17, 2016
We've talked a bit in the past about CCM #1141 (comment). The primary issue is the length prefixing requiring you to know the length of your data before encrypting. Our current APIs assume a streaming interface (which was a design mistake for AEAD modes but that's what we have for now). If we build a "one shot" AEAD API (provide entire payload, get back encrypted blob, no streaming) then we can talk about whether CCM should be supported.
ria4 commentedon Aug 18, 2016
Thanks for pointing out the issue. Indeed adding CCM support entails some work more convoluted than I expected. For now, I think that we'd be better off using pycryptodome (a fork from pycrypto), as it provides the AEAD modes we need, among other things. Hopefully we could switch to cryptography for a later release.
reaperhulk commentedon Sep 3, 2016
Okay, AEAD API proposal time...
To encrypt:
To decrypt:
Where
AEADAlgorithmis an interface attached classes that instantiate like:ChaCha20Poly1305(key)AESOCB(key, nonce)AESGCM(key, iv)This closely mimics the low level AEAD API that BoringSSL implements.
This has the virtue of not being exposing unauthenticated plaintext in any situation, so it's generally a superior API to our current streaming API (which only supports AEAD via GCM anyway). We would probably want to update our docs to discourage the use of our streaming interface and steer users toward the AEAD API where possible (and of course Fernet if they can).
Disadvantages
The creation of a new interface that combines cipher + mode (or cipher + MAC in the case of chacha20poly1305) is a shift from our current cipher interface that emphasizes composability.
Additionally, this would be a hazmat API as it has no protection against nonce/iv misuse nor does it specify an output format (unlike Fernet).
reaperhulk commentedon Sep 3, 2016
Oh, forgot to mention that an AEAD API would allow us to support
CCM, which we have a user request for above :)19 remaining items
gpotter2 commentedon Mar 23, 2017
I meant ChaCha20Poly1305.
Cool, so that's pretty soon... nice to hear :)
Thanks
And what about CCM ?
reaperhulk commentedon Mar 24, 2017
CCM would come after. If we implement per-construct AEAD interfaces instead of trying to build a generic one then CCM (hopefully) becomes an easier problem.
gpotter2 commentedon Mar 24, 2017
Thanks a lot !
Make prereq module's is_nacl_available private
reaperhulk commentedon Jun 4, 2017
I'm going to go ahead and close this issue and open separate ones for ChaCha and CCM (yuck). OCB is off the table until someone provides a use case. refs #3667
ThomasWaldmann commentedon Nov 16, 2018
I heard good things about OCB, faster than GCM, no patent issue any more for opensource projects.
GCM otoh seems to cause bad feelings for cryptographers, they consider it a fragile construction.
Recently the was some breakage for OCB2 though - but guess this does not affect OCB(1), right?
The use case is just to have a "single pass" AEAD cipher, with HW acceleration in popular cpus, without fragility. Considering it as a candidate for borgbackup.
reaperhulk commentedon Nov 16, 2018
OCB1 and 3 are not affected by the OCB2 break. OpenSSL implements OCB3. There is no hardware acceleration for OCB outside of the core AES acceleration, although it is a fast and elegant construction in general.
Unfortunately, OCB still has some patent considerations (grant here: https://wiki.openssl.org/images/6/66/OCB-patent-grant-OpenSSL.pdf). That should clear our users, but I'm not a huge fan of having this complexity hidden in a random mode we implement.
ThomasWaldmann commentedon Nov 17, 2018
Well, the benchmarks i saw, showed it being significantly faster than GCM.
Also, no bad feelings, so it sounded like a winner.
As the OCB implementation is in openssl, I guess it is not a problem for
cryptographyorborgbackupand users can still decide whether they want to use it or not.Considering single-pass, accelerated AEAD modes, there are no other good options, right?