vendredi 3 mai 2019

How to make Golang seed init stronger

I will see people use this method to random seed init for Go to make random!

func init() {
    rand.Seed(time.Now().UTC().UnixNano())
}

I am 100% sure this method is not safe, guess time.Now().UTC().UnixNano() is 1000X> easy then find real generated random password

Does any one have an idea, also call windows api to generate random seed is good idea I think?




Aucun commentaire:

Enregistrer un commentaire