public static DeterministicKey createMasterPrivateKey(byte[] seed) throws HDDerivationException {
  checkArgument(seed.length > 8,"Seed is too short and could be brute forced");
  byte[] i=HDUtils.hmacSha512(MASTER_HMAC_SHA512,seed);
  checkState(i.length == 64,i.length);
  byte[] il=Arrays.copyOfRange(i,0,32);
  byte[] ir=Arrays.copyOfRange(i,32,64);
  Arrays.fill(i,(byte)0);
  DeterministicKey masterPrivKey=createMasterPrivKeyFromBytes(il,ir);
  Arrays.fill(il,(byte)0);
  Arrays.fill(ir,(byte)0);
  return masterPrivKey;
}

public static DeterministicKey createMasterPrivateKey ( byte [ ] seed ) throws HDDerivationException { checkArgument ( seed . length > 8 , "Seed is too short and could be brute forced" ) ; byte [ ] i = HDUtils . hmacSha512 ( MASTER_HMAC_SHA512 , seed ) ; checkState ( i . length == 64 , i . length ) ; byte [ ] il = Arrays . copyOfRange ( i , 0 , 32 ) ; byte [ ] ir = Arrays . copyOfRange ( i , 32 , 64 ) ; Arrays . fill ( i , ( byte ) 0 ) ; DeterministicKey masterPrivKey = createMasterPrivKeyFromBytes ( il , ir ) ; Arrays . fill ( il , ( byte ) 0 ) ; Arrays . fill ( ir , ( byte ) 0 ) ; return masterPrivKey ; }
generates a new deterministic key from the given seed , which can be any arbitrary byte array . however resist the temptation to use a string as the seed - any key derived from a password is likely to be weak and easily broken by attackers ( this is not theoretical , people have had money stolen that way ) . this method checks that the given seed is at least 64 bits long .
