Skip to main content

3072-bit signing keys for new applications

Category
Security
Published

New applications now sign tokens with a 3072-bit RSA key.

Every new Clerk application now gets a 3072-bit RSA signing key instead of a 2048-bit one. Clerk signs session tokens and JWT template tokens with this key. When you create a production instance from a development instance, it keeps the development instance's key size. Existing instances keep their current key.

This key size follows the NSA's guidance on preparing for post-quantum cryptography, which accepts 3072-bit RSA as an interim choice. Clerk-managed signing keys have always used RSA, not the 256-bit elliptic-curve algorithms, such as ES256, that the guidance discourages. Connections to Clerk already support post-quantum key exchange over TLS 1.3, which current versions of all major browsers use by default.

The algorithm is still RS256, so the alg value in your instance's JWKS doesn't change. Signatures are longer, so each token is about 170 characters longer.

Compatibility

Clerk SDKs verify tokens through your instance's JWKS by default. Every version of @clerk/backend since 1.0.0 supports 3072-bit keys there, as do Clerk's Go, Python, Ruby, Java, C#, and PHP SDKs.

If you verify tokens without a network call by setting jwtKey or CLERK_JWT_KEY, you need @clerk/backend 3.36.0 or later on 3.x, or 2.35.0 or later on 2.x. On an earlier version, update your Clerk SDK or remove the pinned key. If you set CLERK_JWT_KEY, npx clerk@latest doctor checks this for you. See Manual JWT verification for details.

With the longer signature, check that session tokens with large custom claims still fit the 4KB cookie size limit.

What's next

We'll add a Dashboard option that lets you rotate your existing application's signing keys yourself.

Once that's in place, we'll move on to post-quantum signatures and release SDK updates to support them.

Contributor
Dominic Couture

Share this article