This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes SecureRandom & Base64 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "SecureRandom & Base64" Watch "SecureRandom & Base64" New topic

SecureRandom & Base64

James Dekker
Ranch Hand

Joined: Dec 09, 2006
Posts: 215

Am new to this...

What is the *BEST* way to create a SecureRandom number and then convert it to BASE64?

This is what I have so far:

Thank you,

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42371
I'm not sure that there is "a best way". The way you're using it seems fine, although I'd probably use a different library for base-64 encoding (like Jakarta Commons Codec). But that's a minor detail.

Ping & DNS - my free Android networking tools app
jQuery in Action, 2nd edition
subject: SecureRandom & Base64