title: Secure random number generation for all Android versions
body: <p>I am currently playing around with the idea of an application for android which involves encryption. I am planning to use aes in ctr mode and PBKDF2 with whirlpool for key stretching.</p>
  
  <p>I am going to implement a new bouncy castle implementation instead of androids built in old implementation. To make sure it works as intended on any android version.</p>
  
  <p>But I am having some problem figuring out a solid way to generate random numbers for salt and key. I have read somewhere that the built in secure random in android is insecure in some old android versions and I have also heard that most android phones have a hard time keeping a high entropy in dev/random and blocks often. Shouldn’t that have a huge impact on the security of dev/urandom?
  I am therefore looking for good ways to use the sensors on the phone to gather more entropy.</p>