Open biscoe916 opened 4 months ago
~It's worth noting that without knowing the curve, we will be accepting an O(N) cost. I like the idea of requiring the curve, but would use a different character like ec-wrapped:ed25519
for easier parsing.~
Edit: not correct
It's worth noting that without knowing the curve, we will be accepting an O(N) cost. I like the idea of requiring the curve, but would use a different character like
ec-wrapped:ed25519
for easier parsing.
Yea, good call. I updated option two to reflect your suggestion.
@biscoe916 Are we wrapping the key in this method? Just thinking we should maybe remove wrapped
from type
if we aren't actually wrapping the symmetric key anymore in the manifest.
Couple more questions
alg
field here like what was done in policyBinding
?Yea, I had a few examples like ec-protected, but dropped them for this doc - figured we'd have the discussion as to what the type string should actually be once we've selected an option.
I also considered adding an alg field, open to discussing it. That would solve the, "where do we put the curve" question.
Regarding splits, you would need to gen an ephemeral key pair, followed by deriving a shared secret, then symmetric key, for every key access object. Then combine for the payload key. That's off the cuff, though. There may be a different/better way.
It's worth noting that without knowing the curve, we will be accepting an O(N) cost. I like the idea of requiring the curve, but would use a different character like
ec-wrapped:ed25519
for easier parsing.
We determined that this isn't true. (🏆 to @biscoe916)
How will this work with kas federation?
@biscoe916 looks like ECIES flow proposed at the beginning of the ADR looks great. The format of the KAO in option 4 makes sense with that in mind.
Also for KAS purposes, make it explicit that we'll generate 256, 384 and 521 keys by default so that SDKs have max flexibility if thats what we want
Background
Recently, we've discussed at length how we might improve the performance of the platform, while not compromising security. One of the more obvious levers to pull is to improve the performance of the various cryptographic operations that takes place in the platform - both on the client, as well as on the backend.
RSA is currently the algorithm supported across all of our clients, and backend services. It's used for rewrapping payload keys, validating auth tokens, and, for deployments with DPOP enabled, validating DPOP signatures.
This ADR proposes switching to ECC as it is superior across several dimensions we care about:
RSA vs. ECC Strength and Performance
RSA vs ECC Performance (Operations per Second)
Standards and compliance
NIST has approved ECC algorithms as part of their cryptographic standards. ECC is also FIPS 140-2/140-3 compliant.
How ECC "rewrap" will work
Rewrap using elliptic curves will use ECIES (Elliptic Curve Integrated Encryption Scheme), in the same way the NanoTDF specification does. Below is step by step, how a symmetric key is create/derived, and protected.
ECIES is a hybrid encryption scheme, meaning it uses both public-key (asymmetric) and secret-key (symmetric) cryptography. The high-level steps involved in an ECIES fit for our purposes are:
Encryption
Decryption
Options
Option 1 - Use existing spec w/ "ec-wrapped" type
We can use the existing spec, and just add a new Key Access Object
type
- probablyec-wrapped
, or something similar.The ephemeral public key which was used to derive the shared secret would be placed in the
wrappedKey
field. The problem with this approach is that our SDKs would need to include functionality to inspect the ECC public keys to determine which curve was used. Option 2 proposes using the type field to also specify the curve.Example
Option 2 - Use existing spec w/ curve as the KAO type
Same as option one, but we use the type field to specify which curve was used. Probably unnecessary as the curve is encoded into the key.
Example
Option 3 - Update the spec to more closely resemble NanoTDF's fields
This approach uses the ec-wrapped type, but adds the
ephemeralPublicKey
field to be more clear that what's being passed to the KAS isn't a wrappedKey exactly, but instead a public key used to derive the shares secret.Example
Option 4 - Update the spec to more closely resemble NanoTDF's fields
This approach uses the ec-wrapped type, but adds the
ephemeralPublicKey
field to be more clear that what's being passed to the KAS isn't a wrappedKey exactly, but instead a public key used to derive the shares secret.Example