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
  #11 (permalink)  
Old July 3rd, 2013, 05:29 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

I'd recommend double checking the obfuscation settings. If that doesn't help try the netbeans user list. I'm pretty sure people are able to use Netbeans successfully, I'd have heard about this otherwise elsewhere.

Regards,

David
Reply With Quote
  #12 (permalink)  
Old July 3rd, 2013, 06:37 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
Default

this is my code :
im trying to encrypt AES key with RSA encryption and in this line :
BigInteger exponent_int = new BigInteger(1, exponent);
im getting exception:

private byte[] RSA_Encrypt(byte[] Key) {

try {
byte[] aesKey = Helper.encodeToBase64((Helper.encodeToBase64(Key). getBytes("UTF-8"))).getBytes("UTF-8");

byte[] moduluss = Base64.decode(Constants._DEFAULT_RSA_MODULES);
byte[] exponent = Base64.decode(Constants._DEFAULT_RSA_EXPONENET);
BigInteger exponent_int = new BigInteger(1, exponent);
BigInteger modulus_int = new BigInteger(1, moduluss);

RSAKeyParameters rsapa = new RSAKeyParameters(false, modulus_int, exponent_int);
AsymmetricBlockCipher eng = new RSAEngine();
eng = new PKCS1Encoding(eng);
eng.init(true, rsapa);
byte[] toenc = eng.processBlock(aesKey, 0, aesKey.length);
return toenc;

} catch (NumberFormatException ex) {
System.out.println("\nNumberFormatException : " + ex.getMessage().toString());
} catch (IOException ex) {
System.out.println("\nIOException : " + ex.getMessage().toString());
}catch (InvalidCipherTextException ex) {
System.out.println("\nInvalidCipherTextException : " + ex.getMessage().toString());
}catch (NoClassDefFoundError ex) {
System.out.println("\nNoClassDefFoundError : " + ex.getMessage().toString());
}
return null;
}
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 06:14 PM.


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