COSE and JOSE Registrations for WebAuthn Algorithms
Microsoft
mbj@microsoft.com
http://self-issued.info/
Security
COSE Working Group
Cryptography
Digital Signature
Encryption
Internet-Draft
W3C
World Wide Web Consortium
WebAuthn
Web Authentication
FIDO Alliance
FIDO
FIDO2
CTAP
CTAP2
The W3C Web Authentication (WebAuthn) specification
and the FIDO Alliance Client to Authenticator Protocol (CTAP) specification
use CBOR Object Signing and Encryption (COSE) algorithm identifiers.
This specification registers the following algorithms in the IANA "COSE Algorithms" registry,
which are used by WebAuthn and CTAP implementations:
RSASSA-PKCS1-v1_5 using SHA-256, SHA-384, SHA-512, and SHA-1,
and ECDSA using the secp256k1 curve and SHA-256.
It registers the secp256k1 elliptic curve in the IANA "COSE Elliptic Curves" registry.
Also, for use with JSON Object Signing and Encryption (JOSE),
it registers the algorithm ECDSA using the secp256k1 curve and SHA-256
in the IANA "JSON Web Signature and Encryption Algorithms" registry
and the secp256k1 elliptic curve in the IANA "JSON Web Key Elliptic Curve" registry.
This specification defines how to use several algorithms with
CBOR Object Signing and Encryption (COSE)
that are used by implementations of the
W3C Web Authentication (WebAuthn)
and FIDO Alliance FIDO2 Client to Authenticator Protocol (CTAP) specifications.
This specification registers these algorithms in
the IANA "COSE Algorithms" registry
and registers an elliptic curve in the
IANA "COSE Elliptic Curves" registry .
This specification also registers a corresponding algorithm
for use with JSON Object Signing and Encryption (JOSE) in
the IANA "JSON Web Signature and Encryption Algorithms" registry
and registers an elliptic curve in the
IANA "JSON Web Key Elliptic Curve" registry .
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
BCP 14 when, and
only when, they appear in all capitals, as shown here.
The RSASSA-PKCS1-v1_5 signature algorithm is defined in .
The RSASSA-PKCS1-v1_5 signature algorithm is parameterized with a hash function (h).
A key of size 2048 bits or larger MUST be used with these algorithms.
Implementations need to check that the key type is 'RSA' when creating or verifying a signature.
The RSASSA-PKCS1-v1_5 algorithms specified in this document are in the following table.
Name
Value
Hash
Description
Recommended
RS256
TBD (temporary assignment -257 already in place)
SHA-256
RSASSA-PKCS1-v1_5 using SHA-256
No
RS384
TBD (temporary assignment -258 already in place)
SHA-384
RSASSA-PKCS1-v1_5 using SHA-384
No
RS512
TBD (temporary assignment -259 already in place)
SHA-512
RSASSA-PKCS1-v1_5 using SHA-512
No
RS1
TBD (temporary assignment -65535 already in place)
SHA-1
RSASSA-PKCS1-v1_5 using SHA-1
Deprecated
Security considerations for use of the first three algorithms
are in .
Security considerations for use of the last algorithm
are in .
Note that these algorithms are already present in the
IANA "JSON Web Signature and Encryption Algorithms" registry ,
and so these registrations are only for the
IANA "COSE Algorithms" registry .
This section defines algorithm encodings and representations enabling the
Standards for Efficient Cryptography Group (SECG) elliptic curve
secp256k1 to be used for
JOSE and
COSE messages.
The Standards for Efficient Cryptography Group (SECG) elliptic curve
secp256k1 is represented in
a JSON Web Key (JWK) using these values:
kty: EC
crv: secp256k1
plus the values needed to represent the curve point,
as defined in Section 6.2.1 of .
As a compressed point encoding representation is not defined for JWK elliptic curve points,
the uncompressed point encoding defined there MUST be used.
The x and y values
represented MUST both be exactly 256 bits, with any leading zeros preserved.
Other optional values such as alg MAY also be present.
It is represented in a COSE_Key using these values:
kty (1): EC2 (2)
crv (-1): secp256k1 (TBD - requested assignment 8)
plus the values needed to represent the curve point,
as defined in Section 13.1.1 of .
Either the uncompressed or compressed point encoding representations defined there can be used.
The x value
represented MUST be exactly 256 bits, with any leading zeros preserved.
If the uncompressed representation is used, the y value
represented MUST likewise be exactly 256 bits, with any leading zeros preserved;
if the compressed representation is used, the y value
MUST be a boolean value, as specified in Section 13.1.1 of .
Other optional values such as alg (3) MAY also be present.
The ECDSA signature algorithm is defined in .
This specification defines the ES256K algorithm identifier,
which is used to specify the use of ECDSA with the secp256k1 curve
and the SHA-256 cryptographic hash function.
Implementations need to check that the key type is EC for JOSE or
EC2 (2) for COSE
and that the curve of the key is secp256k1
when creating or verifying a signature.
The ECDSA secp256k1 SHA-256 digital signature is generated as follows:
Generate a digital signature of the JWS Signing Input
or the COSE Sig_structure
using ECDSA secp256k1 SHA-256 with
the desired private key. The output will be the pair
(R, S), where R and S are 256-bit unsigned integers.
Turn R and S into octet sequences in big-endian order,
with each array being be 32 octets long.
The octet sequence representations MUST NOT be shortened
to omit any leading zero octets contained in the values.
Concatenate the two octet sequences in the order R and then S.
(Note that many ECDSA implementations will directly produce
this concatenation as their output.)
The resulting 64-octet sequence is the JWS Signature or COSE signature value.
Implementations SHOULD use a deterministic algorithm to generate
the ECDSA nonce, k, such as .
However, in situations where devices are vulnerable to physical attacks,
deterministic ECDSA has been shown to be susceptible to fault injection attacks
.
Where this is a possibility, implementations SHOULD implement appropriate countermeasures.
Where there are specific certification requirements (such as FIPS approval),
implementors should check whether deterministic ECDSA is an approved nonce generation method.
The ECDSA secp256k1 SHA-256 algorithm specified in this document uses these identifiers:
JOSE Alg Name
COSE Alg Value
Description
Recommended
ES256K
TBD (requested assignment -47)
ECDSA using secp256k1 curve and SHA-256
Yes
Implementation of this algorithm is recommended because of its widespread use
in decentralized systems and those that chose it over the NIST curves.
When using a JWK or COSE_Key for this algorithm, the following checks are made:
The kty field MUST be present and
it MUST be EC for JOSE
or EC2 for COSE.
The crv field MUST be present and
it MUST represent the secp256k1 elliptic curve.
If the alg field is present,
it MUST represent the ES256K algorithm.
If the key_ops field is present,
it MUST include sign when creating an ECDSA signature.
If the key_ops field is present,
it MUST include verify when verifying an ECDSA signature.
If the JWK use field is present,
its value MUST be sig.
This specification defines how to use the secp256k1 curve for ECDSA signatures
for both JOSE and COSE implementations.
While in theory, the curve could also be used for ECDH-ES key agreement,
it is beyond the scope of this specification to state whether this is or is not advisable.
Thus, whether to recommend its use with ECDH-ES is left for experts to decide in future specifications.
When used for ECDSA, the secp256k1 curve MUST be used only with the
ES256K algorithm identifier and not any others,
including not with the COSE ES256 identifier.
Note that the ES256K algorithm identifier needed to be introduced
for JOSE to sign with the secp256k1 curve because the JOSE ES256 algorithm
is defined to be used only with the P-256 curve.
The COSE treatment of how to sign with secp256k1 is intentionally parallel to that for JOSE,
where the secp256k1 curve MUST be used with the ES256K algorithm identifier.
This section registers the following values in the
IANA "COSE Algorithms" registry .
Name: RS256
Value: TBD (temporary assignment -257 already in place)
Description: RSASSA-PKCS1-v1_5 using SHA-256
Reference: of this document
Recommended: No
Name: RS384
Value: TBD (temporary assignment -258 already in place)
Description: RSASSA-PKCS1-v1_5 using SHA-384
Reference: of this document
Recommended: No
Name: RS512
Value: TBD (temporary assignment -259 already in place)
Description: RSASSA-PKCS1-v1_5 using SHA-512
Reference: of this document
Recommended: No
Name: RS1
Value: TBD (temporary assignment -65535 already in place)
Description: RSASSA-PKCS1-v1_5 using SHA-1
Reference: of this document
Recommended: Deprecated
Name: ES256K
Value: TBD (requested assignment -47)
Description: ECDSA using secp256k1 curve and SHA-256
Reference: of this document
Recommended: No
This section registers the following value in the
IANA "COSE Elliptic Curves" registry .
Name: secp256k1
Value: TBD (requested assignment 8)
Key Type: EC2
Description: SECG secp256k1 curve
Change Controller: IESG
Reference: of [[ this specification ]]
Recommended: No
This section registers the following value in the
IANA "JSON Web Signature and Encryption Algorithms" registry .
Algorithm Name: ES256K
Algorithm Description: ECDSA using secp256k1 curve and SHA-256
Algorithm Usage Locations: alg
JOSE Implementation Requirements: Optional
Change Controller: IESG
Reference: of [[ this specification ]]
Algorithm Analysis Document(s):
This section registers the following value in the
IANA "JSON Web Key Elliptic Curve" registry .
Curve Name: secp256k1
Curve Description: SECG secp256k1 curve
JOSE Implementation Requirements: Optional
Change Controller: IESG
Specification Document(s): of [[ this specification ]]
The security considerations on key sizes for RSA algorithms
from Section 6.1 of also apply to the RSA algorithms
in this specification.
The security considerations on the use of RSASSA-PKCS1-v1_5 with SHA-2 hash functions
(SHA-256, SHA-384, and SHA-512)
from Section 8.3 of also apply to their use
in this specification.
For that reason, these algorithms are registered as being "Not Recommended".
The security considerations on the use of the SHA-1 hash function
from apply in this specification.
For that reason, the "RS1" algorithm is registered as "Deprecated".
Likewise, the exponent restrictions described in
Section 8.3 of also apply.
A COSE algorithm identifier for this algorithm is nonetheless being registered
because deployed TPMs continue to use it, and therefore WebAuthn implementations
need a COSE algorithm identifier for "RS1" when TPM attestations using
this algorithm are being represented.
New COSE applications MUST NOT use this algorithm.
Care should be taken that a secp256k1 key is not mistaken for a P-256 key,
given that their representations are the same
except for the crv value.
The procedures and security considerations described in the
, , and
specifications apply to implementations of this specification.
Digital Signature Standard (DSS)
National Institute of Standards and
Technology (NIST)
SEC 1: Elliptic Curve Cryptography
Standards for Efficient Cryptography Group
SEC 2: Recommended Elliptic Curve Domain Parameters
Standards for Efficient Cryptography Group
Web Authentication: An API for accessing Public Key Credentials - Level 1
Google
balfanz@google.com
Google
aczeskis@google.com
Google
Jeff.Hodges@paypal.com
Mozilla
jc@mozilla.com
Microsoft
mbj@microsoft.com
http://self-issued.info/
Microsoft
akshayku@microsoft.com
Microsoft
huliao@microsoft.com
Nok Nok Labs
rolf@noknok.com
Yubico
emil@yubico.com
Client to Authenticator Protocol (CTAP)
Google
cbrand@google.com
Google
aczeskis@google.com
Yubico
jakob@yubico.com
Microsoft
mbj@microsoft.com
http://self-issued.info/
Microsoft
akshayku@microsoft.com
Nok Nok Labs
rolf@noknok.com
FIDO Alliance
adam@fidoalliance.org
OneSpan
johan.verrept@onespan.com
COSE Algorithms
IANA
COSE Elliptic Curves
IANA
JSON Web Signature and Encryption Algorithms
IANA
JSON Web Key Elliptic Curve
IANA
How to defeat Ed25519 and EdDSA using faults
Kudelski Security
Attacking Deterministic Signature Schemes using Fault Attacks
Münster University of Applied Sciences
Ruhr University Bochum
Münster University of Applied Sciences
Federal Office for Information Security
Ruhr University Bochum
Thanks to
Linda Dunbar,
Stephen Farrell,
John Fontana,
Jeff Hodges,
Kevin Jacobs,
J.C. Jones,
Benjamin Kaduk,
Murray Kucherawy,
Neil Madden,
John Mattsson,
Matthew Miller,
Tony Nadalin,
Matt Palmer,
Eric Rescorla,
Rich Salz,
Jim Schaad,
Göran Selander,
Wendy Seltzer,
Sean Turner,
and
Samuel Weiler
for their roles in registering these algorithm identifiers.
[[ to be removed by the RFC Editor before publication as an RFC ]]
-07
Addressed editorial SecDir review comment by Linda Dunbar about SHA-2 algorithms.
Addressed IETF last call comments by Jim Schaad, Rich Salz, and Eric Rescorla,
now registering secp256k1 and ES256K as "Recommended: No" for COSE.
-06
Addressed Area Directory review comment by Murray Kucherawy (which requested an editorial correction).
Changed requested assignment for ES256K from -46 to -47, due to an assignment conflict.
-05
Removed unused reference to RFC 7049.
-04
Added explanatory comments on design decisions made that were discussed on the mailing list
that Jim Schaad requested be added to the draft.
-03
Addressed review of -02 by Jim Schaad.
-02
Addressed working group last call comments.
Thanks to J.C. Jones, Kevin Jacobs, Jim Schaad, Neil Madden, and Benjamin Kaduk
for their useful feedback.
-01
Changed the JOSE curve identifier from P-256K
to secp256k1.
Specified that secp256k1 signing is done using the SHA-256 hash function.
-00
Created the initial working group draft from draft-jones-cose-additional-algorithms-00,
changing only the title, date, and history entry.