yggdrasil-go
yggdrasil-go copied to clipboard
Prepend keys with something like "pub:" or "sec:" or similar?
Curremtly those lines only include the key. I wonder if it would be a good idea to begin the public key with something like pub:
(I am taking inspiration from GPG) so it would become pub:TheLongKeyStringHere
so there would be less room for user error while sharing the EncryptionPublicKey.
My usecase is that I am keeping list of the keys I care about in a public git repository here and I find it scary to wonder if I made a mistake after all and copied the private key regardless of all checking as git diff
won't assure me that all lines begin with pub:
or otherwise make it clear which is which.
I guess that if this gets implemented, it would probably be necessary to support strings without it and wonder if the config sanitation could handle this update also?
Not 100% sure if we want to do this, but if we assume for the sake of argument that we do, then it should be easy to parse keys with/without the pub:
prefix. Keys are hex encoded in the configs, so it's simple enough to check for a non-hex character like :
and then apply extra checks or skip ahead to the key part.
Thinking long term, there's lots of cases (both in the config and in the code) where the type of a key is hard-coded and not explicitly stated. Perhaps it makes sense to specify what kind of key these things all are, so in the future we could introduce other key types, in case a practical post-quantum alternative to the current nacl crypto becomes available. Likewise for hash functions.
Marking for v0.3 since we should at least be able to decide on the config file part by then, I think.
We didn't do anything about this in v0.4 either, so not sure if we're going to take action on this or just leave it as-is?