Go's ed25519 package exposes a function which allows creating a private key from a 32 byte seed.
The reason I want to use this is because this is only 32 bytes, hence easy to copy and pass around.
I assume if I use a cryptograpically secure source of random for the seed, I should be ok in terms of security for the ed25519 key.
(Ideally I'd go even smaller if I could, without compromising on security).
Now I'd like to derive an AES key for encryption from those 32 bytes I already have (or the pub/priv key generated by the seed).
I would like anyone with the seed (or the private key) to be able to do the same.
Now there might be three types of clients:
- Clients that have the seed/private key, who are able to derive the AES key, encrypt and sign the encrypted data. (needs 32 bytes for privkey or seed)
- Clients that have the public key, and are able to verify the data has not been tampered with, but not be able to decrypt the data. (needs 32 bytes for pubkey)
- Clients that have the public key and AES key, who area able to verify and decrypt data, but not able to sign it themselves (needs 64 bytes, 32 for pubkey, 32 for aes key)
How could I derive an AES key securely for this matter?
My gut says to use pbkdf2 on the private part of the ed25519 key to generate a AES key, but I am not sure if it somehow weakens the security.
Using pbkdf2 on the seed feels like it would compromise the security even more?