Replaced stuff requiring Bouncy Castle so it isn't required anymore.

Replaced stuff requiring Bouncy Castle so it isn't required anymore. I used methods available from libraries already imported to generate the key.