SecureRandom Sha1Prng throws Unsupported Operation Exception

194 views Asked by At

I am using java's Secure Random in a kotlin application. When I instantiate it with "DRBG" and seed:

     val rng : SecureRandom = SecureRandom.getInstance("DRBG")
     rng.reseed()

everything works fine. However when I do the same with "SHA1PRNG":

     val rng : SecureRandom = SecureRandom.getInstance("SHA1PRNG")
     rng.reseed()

I get an unsupported operation exception. How can I fix this? I am aware that I do not have to seed after constructing, but I do need to reseed later, and I get the same error.

0

There are 0 answers