2 ms·
ASN.1 and stuff were developed with crypto agility in mind [0]. Right now ed25519 is enough but maybe in the future we might be using quantum ready algorithms i
by est31 6y ago
ASN.1 and stuff were developed with crypto agility in mind [0]. Right now ed25519 is enough but maybe in the future we might be using quantum ready algorithms instead. Your 32 bytes in the wire protocol might not be enough for that. And how would it know when given a hex string whether it's an ed25519 key or a post quantum crypto key? If it's ASN.1 encoded, you can just check the OIDs.
Of course it all depends on your domain. Maybe you build an app that won't be used any more in 3 years. But if you feel like your protocol will be implemented by many vendors and you might want to allow vendors to use multiple algorithms so that support for alternatives is already present if a vulnerability is found in algorithm, it's better to have self describing key data instead.
[0]: https://en.wikipedia.org/wiki/Cryptographic_agility https://en.wikipedia.org/wiki/Cryptographic_agility
- CameronNemo 6y agoWell if you were using something like protobuf/gRPC, you could evolve the API.
- yuliyp 6y agoOr you can encapsulate it so that the API layer doesn't need to worry about the crypto format.