1

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.

cershif
  • 154
  • 1
  • 13
  • 1
    Might want to check out this answer - https://stackoverflow.com/a/27638413/49746 – Todd Nov 02 '21 at 22:49
  • @Todd the issue is that I originally called the constructor directly with no parameter - `val rng = new SecureRandom()`. this worked on my machine but then gave the unsupported operation exception detailed in my post. – cershif Nov 02 '21 at 23:51

0 Answers0