Replies: 1 comment 5 replies
-
The main practical problem (that has come across a couple times) is that people want to use non-Sparkle tools for signing their updates. It may be a good idea to (with compatibility implications considered):
Of these, I actually consider importing the least important. I am not sure if DER format is the 'right' choice. What are the bytes after the header? Is it Consider the scenario that someone generated keys with Sparkle and wants to export the keys to use in a tool where they use libsodium, CryptoKit, a golang library, or whatever else. Is the format we land on make it easy/feasible for them to do that? Note that I don't want to pull in other dependencies. It makes sense the library we use throws away the seed as apparently reading through the issues it predates other libraries and the RFC. |
Beta Was this translation helpful? Give feedback.
-
Hi,
this is an idea to solve the issue with Sparkle's Ed25519 keys which use a format that cannot be used by other libraries (CryptoKit, OpenSSL, BoringSSL) or services (Azure Key Vault) to do signing.
As noted on https://github.com/orlp/ed25519 their implementation will generate Ed25519
seed
value and generate derived private key and a public key. Theseed
value is thrown away and Sparkle will use the derived private key to do signing.Other libraries tend to use the
seed
as input material for signing (and internally they generate the derived private key). While theseed
can be used to create derived private key, there is no way to retrieve originalseed
from derived private key.Proposed Solution
Some customers may have special needs for the Ed25519 keys. Either for security or compliance reasons they must keep the original
seed
value.To make Sparkle compatible with user generated Ed25519 keys, the
generate_keys
tool should support importing a DER encoded Ed25519 key and store it in Sparkle's format.DER format is chosen because it is efficient (it's binary), it describes the key material and it is used by other tools (eg. NodeJS crypto library uses DER to work with private keys). DER header stores information about algorithm - the OID value for EdDSA25519 (which is 1.3.101.112).
Sample header for EdDSA25519 encoded file:
Sample DER file for Ed25519 key
a1111aaacfc876914535947e2a06b838c97cef72fee7e24515caf94ad596ecf0
(the file is encoded in binary as is shown in hex here):This allows the
generate_keys
to identify data in imported file and in case of DER encoded key to import theseed
value and generate Sparkle key-pair using theed25519_create_keypair()
function. The fallback would be to read the file as Base64 as import the Sparkle key-pair as it does now.Use Cases
Being able to use own Ed25519 key (having access to the
seed
value) enables customers to:References
Beta Was this translation helpful? Give feedback.
All reactions