java - How to generate a key with seed? -
i need generate key algorithm seed (byte array). code doesn't work, because it's give 2 different results on different platforms:
byte seed [] = {50,30,...}; byte result [] = new byte [20]; securerandom rand = new securerandom(); rand.setseed(seed); rand.nextbytes(result);
i need same results on different platforms.
use sha1prng algorithm istead of nativeprng.
securerandom rand = securerandom.getinstance("sha1prng"); rand.setseed(seed); rand.nextbytes(result);
Comments
Post a Comment