Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to generate 128 bits binary?

843811Feb 25 2005 — edited Feb 25 2005
Dear all,

I have to generate 128 bits binary challenge/response. I have created 128 bits String but it is too large for encrypt and decrypt. Can you tell me how to change to 128 bits binary byte or integer so the size can be reduced for encrypt/decrypt?

Thanks a lots!!!!!

Random rand = new Random();

int a;
String nonce = "";
for (int i = 0; i < 128; i++) {
a = rand.nextInt(2);
nonce = nonce + String.valueOf(a);
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 25 2005
Added on Feb 25 2005
3 comments
434 views