dimanche 20 juin 2021

Is this way of generating a securerandom biginteger secure?

So i tried this line of code in java which generates a random integer that is 40 bytes long. I have no clue if its secure and i was wonder if anyone with a little bit more experience than me could explain.

i would like to know if this is cryptographically secure. meaning is this a secure way of generating a random number thats a biginteger. If it isnt secure what would be a good way to generate a full cryptographically random biginteger.

            SecureRandom random = new SecureRandom();
            BigInteger key_limit = new BigInteger("10000000000000000000000000000000000000000");
            int key_length = key_limit.bitLength();
            BigInteger key_1 = new BigInteger(key_length, random);``` 



Aucun commentaire:

Enregistrer un commentaire