ed25519-elisabeth
ed25519-elisabeth copied to clipboard
Proper replacement for ed25519-java library
As pointed out in https://github.com/str4d/ed25519-java/issues/30, there are issue with export/import of ed25519 key:
// Bug in net.i2p.crypto.eddsa and in sshd? Both also compare the
// seed of the private key, but for a generated key, this is some
// random value, while it is all zeroes for a key read from a file.
return KeyUtils.compareKeys(a.getPublic(), b.getPublic())
&& Objects.equals(((EdDSAKey) a.getPrivate()).getParams(),
((EdDSAKey) b.getPrivate()).getParams());
The answer was to examine ed25519-elisabeth
library.
However, ed25519-elisabeth
library lacks the necessary classes required to allows to use it as a SecurityProvider
. Furthermore it's keys do not properly implement java.security.Private/PublicKey
and/or java.security.Signature
. Until it does, it cannot really be use as a replacement for ed25519-java.
Perhaps a more appropriate approach would be to examine and fix:
Both also compare the seed of the private key,
but for a generated key, this is some random value,
while it is all zeroes for a key read from a file.