I'm trying to generate cryptographically secure random numbers using Java and using the following code section to create a SecureRandom object to view its provider and algorithm:
Provider prov=new org.spongycastle.jce.provider.BouncyCastleProvider();
SecureRandom sr=new SecureRandom();
Assuming you are running on Android (you didn't state this explicitly). Bouncy Castle does not provide a
SecureRandom implementation. 'Crypto' is the Apache Harmony (on which most of Android's core Java code is based on) JCE provider. There is no Sun JCE code in Android. BTW, the 'Crypto' provider only provides SHA1PRNG (RNG), SHA-1 (hash) and SHA1withDSA (signature) implementations. Everything else is provided by either Bouncy Castle or the OpenSSL-based provider.
Question: Why do you think you need a
SecureRandom implementation from Bouncy/Spongy Castle?