How to deal with a slow SecureRandom generator?

后端 未结 17 1131
时光说笑
时光说笑 2020-11-22 11:56

If you want a cryptographically strong random numbers in Java, you use SecureRandom. Unfortunately, SecureRandom can be very slow. If it uses

17条回答
  •  迷失自我
    2020-11-22 12:17

    There is a tool (on Ubuntu at least) that will feed artificial randomness into your system. The command is simply:

    rngd -r /dev/urandom
    

    and you may need a sudo at the front. If you don't have rng-tools package, you will need to install it. I tried this, and it definitely helped me!

    Source: matt vs world

提交回复
热议问题