Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Other Java > BOOK: Beginning Cryptography with Java
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Cryptography with Java
This is the forum to discuss the Wrox book Beginning Cryptography with Java by David Hook; ISBN: 9780764596339
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Cryptography with Java section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 3rd, 2007, 09:28 AM
Registered User
 
Join Date: Apr 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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


Reply With Quote
  #2 (permalink)  
Old October 3rd, 2007, 04:50 PM
dgh dgh is offline
Wrox Author
Points: 864, Level: 11
Points: 864, Level: 11 Points: 864, Level: 11 Points: 864, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2005
Location: , , .
Posts: 206
Thanks: 0
Thanked 20 Times in 20 Posts
Default

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

Reply With Quote
  #3 (permalink)  
Old October 11th, 2007, 04:41 AM
Registered User
 
Join Date: Apr 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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


Reply With Quote
  #4 (permalink)  
Old October 11th, 2007, 06:26 AM
dgh dgh is offline
Wrox Author
Points: 864, Level: 11
Points: 864, Level: 11 Points: 864, Level: 11 Points: 864, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2005
Location: , , .
Posts: 206
Thanks: 0
Thanked 20 Times in 20 Posts
Default

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

Reply With Quote
  #5 (permalink)  
Old April 16th, 2009, 03:35 PM
Registered User
 
Join Date: Apr 2009
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
Reply With Quote
  #6 (permalink)  
Old April 19th, 2009, 10:26 AM
Registered User
 
Join Date: Apr 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Littlen View Post
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 ^^
Reply With Quote
  #7 (permalink)  
Old April 19th, 2009, 11:06 AM
Registered User
 
Join Date: Apr 2009
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Default

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.
Reply With Quote
The Following User Says Thank You to wotcha For This Useful Post:
yolzzz (April 19th, 2009)
  #8 (permalink)  
Old April 19th, 2009, 08:02 PM
Registered User
 
Join Date: Apr 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

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??
Reply With Quote
  #9 (permalink)  
Old April 19th, 2009, 11:01 PM
Registered User
 
Join Date: Apr 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

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..^^
Reply With Quote
  #10 (permalink)  
Old July 3rd, 2013, 05:09 AM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy 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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding J2ME Blackberry programming books saravinfotech All Other Wrox Books 1 April 16th, 2007 12:46 PM
Converting string "aA" to a BigInteger kedklok Java Basics 1 March 4th, 2006 02:33 AM
Using j2se's "BufferedWriter" in the j2me emulator johnwen604 J2EE 0 November 7th, 2005 06:25 AM
j2me book sahil All Other Wrox Books 1 February 11th, 2005 07:13 PM
J2ME minhtri JSP Basics 1 June 23rd, 2004 12:50 AM



All times are GMT -4. The time now is 12:27 AM.


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