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
{{ message }}
Repository navigation
Add support for CCM mode (Counter with CBC-MAC) #1141
OpenSSL's CCM support has some really nasty limitations (and it's currently unclear to me what are limitations of the mode itself and what is OpenSSL specific). We'll look into it though.
What is the general opinion of the cryptography team about implementing crypto stuff in cryptography directly? (Most of it would be combining primitives provided by backends I guess.)
Simple enough things work fine, e.g. HKDF is clearly composed of other cryptographic primitives, but is a pure-Python implementation that lives in cryptography.
It looks like this uses CCM Support within OpenSSL itself? That we can do
easily enough; though of course in practice very few users will have access
since it's not even in a released version of OpenSSL.
On Fri, Jun 20, 2014 at 8:51 AM, Wouter Bolsterlee <[email protected]
—
Reply to this email directly or view it on GitHub #1141 (comment).
"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: 125F 5C67 DFE9 4084
CCM is supported in OpenSSL 1.0.1, but the issue with it is that to prevent a variable-length attack on CBC-MAC you need to prepend the length of the message. This means you must know the length prior to encrypting a single block.
It looks like some implementations (like Botan?) may not do this length prefixing, so interoperability in CCM may be problematic...
On Fri, Jun 20, 2014 at 9:02 AM, Paul Kehrer [email protected]
wrote:
CCM is supported in OpenSSL 1.0.1, but the issue with it is that to
prevent a variable-length attack on CBC-MAC you need to prepend the length
of the message. This means you must know the length prior to encrypting a
single block.
It looks like some implementations (like Botan?) may not do this length
prefixing, so interoperability in CCM may be problematic...
—
Reply to this email directly or view it on GitHub #1141 (comment).
"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: 125F 5C67 DFE9 4084
SJCL defaults to CCM and it seems to have some popularity with the crypto
in browser crowd. That seems more of a reason to not implement support
however.
Alex
On Fri, Jun 20, 2014 at 11:39 AM, Alex Stapleton [email protected]
wrote:
Are there any significant users of CCM mode?
—
Reply to this email directly or view it on GitHub #1141 (comment).
We haven't seen any significant demand for this in 2 years and the API design tradeoffs required for CCM make me extremely reluctant to add support. Closing for now.
Please reconsider the "no significant demand" stance in the light of AES-CCM-64-64-128 being the mandatory-to-implement cipher in the upcoming OSCOAP specification for object security in communication with constrained devices. The Python implementation of it currently falls back to cffi-wrangling libssl itself (code), but I'd very much prefer to have a cryptography library provide that instead.
There has been some conversation in #2968 around building per-scheme AEAD interfaces. That would allow us to support CCM. Thanks for the link to a spec that is actively using CCM though, that's helpful!
Activity
wbolster commentedon Jun 16, 2014
Fwiw, PyCrypto 2.7 (not yet released I believe) supports CCM mode. (See https://gist.github.com/jbdatko/7425443 for an example.)
reaperhulk commentedon Jun 16, 2014
OpenSSL's CCM support has some really nasty limitations (and it's currently unclear to me what are limitations of the mode itself and what is OpenSSL specific). We'll look into it though.
wbolster commentedon Jun 20, 2014
What is the general opinion of the
cryptographyteam about implementing crypto stuff incryptographydirectly? (Most of it would be combining primitives provided by backends I guess.)lvh commentedon Jun 20, 2014
Simple enough things work fine, e.g. HKDF is clearly composed of other cryptographic primitives, but is a pure-Python implementation that lives in cryptography.
reaperhulk commentedon Jun 20, 2014
We'll probably make decisions on that on a case by case basis. My incomplete (personal) criteria for accepting it would be something like:
public commentedon Jun 20, 2014
Are there any significant users of CCM mode?
wbolster commentedon Jun 20, 2014
http://en.wikipedia.org/wiki/CCM_mode#Use states that "CCM mode is used in the IEEE 802.11i (as CCMP, an encryption algorithm for WPA2), IPSec, and TLS 1.2."
(And I know it's also used in some embedded systems.)
And of course Python should have it before Ruby has it ;-) ruby/ruby#569
alex commentedon Jun 20, 2014
It looks like this uses CCM Support within OpenSSL itself? That we can do
easily enough; though of course in practice very few users will have access
since it's not even in a released version of OpenSSL.
On Fri, Jun 20, 2014 at 8:51 AM, Wouter Bolsterlee <[email protected]
"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: 125F 5C67 DFE9 4084
reaperhulk commentedon Jun 20, 2014
CCM is supported in OpenSSL 1.0.1, but the issue with it is that to prevent a variable-length attack on CBC-MAC you need to prepend the length of the message. This means you must know the length prior to encrypting a single block.
It looks like some implementations (like Botan?) may not do this length prefixing, so interoperability in CCM may be problematic...
alex commentedon Jun 20, 2014
Ugh. Right.
On Fri, Jun 20, 2014 at 9:02 AM, 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: 125F 5C67 DFE9 4084
acv commentedon Jun 20, 2014
SJCL defaults to CCM and it seems to have some popularity with the crypto
in browser crowd. That seems more of a reason to not implement support
however.
Alex
On Fri, Jun 20, 2014 at 11:39 AM, Alex Stapleton [email protected]
wrote:
reaperhulk commentedon Jun 4, 2016
We haven't seen any significant demand for this in 2 years and the API design tradeoffs required for CCM make me extremely reluctant to add support. Closing for now.
chrysn commentedon Mar 21, 2017
Please reconsider the "no significant demand" stance in the light of AES-CCM-64-64-128 being the mandatory-to-implement cipher in the upcoming OSCOAP specification for object security in communication with constrained devices. The Python implementation of it currently falls back to cffi-wrangling libssl itself (code), but I'd very much prefer to have a cryptography library provide that instead.
reaperhulk commentedon Mar 21, 2017
There has been some conversation in #2968 around building per-scheme AEAD interfaces. That would allow us to support CCM. Thanks for the link to a spec that is actively using CCM though, that's helpful!