4 ms·
They actually aren't. RSA keys, for instance, are defined as a pair of integers (modulus and exponent)[1] and the algorithms are specified as taking these inte
by agwa 6y ago
They actually aren't. RSA keys, for instance, are defined as a pair of integers (modulus and exponent)[1] and the algorithms are specified as taking these integers as input. ECDSA is similar. Therefore, to interchange RSA and ECDSA keys, you need some other specification that tells you how to serialize those integers.
It's true that internally Ed25519 keys are also integers, but the encoding/decoding is encapsulated in the Ed25519 algorithm so to users of Ed25519 they are just byte strings. This is quite a bit nicer in practice than the approach taken by RSA and ECDSA.
[1] https://tools.ietf.org/html/rfc8017#section-3 https://tools.ietf.org/html/rfc8017#section-3
- toast0 6y agoMuch fun[1] can be had because RSA keys are integers. If your key would be encoded with a zero most significant byte, some implementations are fine if that byte is omited, and some will give a nonsensical error instead. [1] Not actually fun, but I got a patch in OpenSSL, so I guess that's neat.
- kaoD 6y agoAdding to the fun: some implementations bark at you if you include it!