Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

In the test of this Java implementation of Ed25519, the signing key is generated this way:

byte[] sk = new byte[32];
Arrays.fill(sk, (byte)0);

Is that correct? If not, please add the necessary Java.

share|improve this question
For a real key you obviously need to use a random 32 byte value, not a hardcoded one, like in a unit test. –  CodesInChaos Jan 12 at 15:33
@CodesInChaos Thank you CodesInChaos! I had a feeling that was wrong. Does it merely need to be random in a sense of using a random number generator such as this with a specified length? cs.geneseo.edu/~baldwin/reference/random.html –  Cincinnatus Jan 12 at 15:50
The SecureRandom class with an implicit seed should work (unless the java implementation does something unusual) –  CodesInChaos Jan 12 at 15:55
@CodesInChaos Thank you so very very much CodesInChaos! I very much appreciate all of your help. I also can't thank you enough for introducing me to Ed25519! –  Cincinnatus Jan 12 at 15:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.