p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning Cryptography with Java (http://p2p.wrox.com/forumdisplay.php?f=187)
-   -   SecureRandom&BigInteger in J2ME (http://p2p.wrox.com/showthread.php?t=62563)

Littlen October 3rd, 2007 09:28 AM

SecureRandom&BigInteger in J2ME
 
Hi all,
Im trying to implement an encryption method in cldc J2ME using Bouncy Castle, however i need to use a number of libraries which aren’t available in J2ME such as:

java.security.PrivateKey;
java.math.BigInteger;
java.security.SecureRandom;

I cant find any version of these libraries in bouncy castle that i can use. Does anyone know how i can implement them?
Thanks a million in advance



dgh October 3rd, 2007 04:50 PM

There is a version of the BC light weight libraries available on the Bouncy Castle Java releases page

http://www.bouncycastle.org/latest_releases.html

Please make sure you read point 3 on

http://www.bouncycastle.org/wiki/dis...sked+Questions

as well.

Regards,

David


Littlen October 11th, 2007 04:41 AM

Thanks to your help I figured out how to implement java.math.BigInteger and java.security.SecureRandom

However i am still unable to implement java.security.PrivateKey within J2ME-CLDC

Does anyone know of any way i can use this?
Thanks again



dgh October 11th, 2007 06:26 AM

Somehow, I managed to miss the reference to PrivateKey in your earlier post. Private key is only available in the most recent CLDC profile. There are equivalent parameter classes in the lightweight API though so you can get by without having to use them. It all depends what sort of private key you want.

Regards,

David


wotcha April 16th, 2009 03:35 PM

I was having problems with BigInteger in a MIDlet I was trying out in Netbeans - I found this post which showed me how to resolve the problem http://discussion.forum.nokia.com/fo...ad.php?t=90558

When I sorted out the Obfuscation in Netbeans (as described in the post), the MIDlet worked ok in Netbeans emulator and on a Nokia Series 40 using Bouncy Castle API
[:D]

yolzzz April 19th, 2009 10:26 AM

Quote:

Originally Posted by Littlen (Post 210386)
Thanks to your help I figured out how to implement java.math.BigInteger and java.security.SecureRandom

However i am still unable to implement java.security.PrivateKey within J2ME-CLDC

Does anyone know of any way i can use this?
Thanks again


Hi, so what should I do in order to use BigInteger for my j2me application...

really need your help please..thanks in advance ^^

wotcha April 19th, 2009 11:06 AM

Well what I did was follow the advice contained in the link in my previous post:-

In Netbeans you go to Project Name-> Properties -> Obfuscating -> and then choose "High". That worked for me when I loaded the .jar on to a Seies 40 Nokia handset.

yolzzz April 19th, 2009 08:02 PM

Hi wotcha ^^

How about if I need to use BigInteger only..and I use Wireless ToolKit, not netbeans..
Is there a manual way to use the library of BC??

yolzzz April 19th, 2009 11:01 PM

have found the solution..\

for WTK user..

just download the lightweight for J2ME

and copy zips/cldc_classes.zip into the lib folder of your project

note: you should have obfusator installed on in order to be able to use the lib..^^

vani rey July 3rd, 2013 05:09 AM

BigInteger exception
 
hello all
im using RSA encryption on LWUIT mobile application
but getting this exception

NoClassDefFoundError : java/math/BigInteger: Cannot create class in system package

im using jdk1.6.0_13 and netbeans 6.7.1 and wtk 2.5.2
i have encluded cldc_classes.zip in my resources and checked obfuscatiing with the highest level with additional setting :
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-ignorewarnings


pls help me to solve this problem
Regards


All times are GMT -4. The time now is 07:44 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.