Wrox Programmer Forums
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 3rd, 2013, 05:29 AM
dgh dgh is offline
Wrox Author
Join Date: Aug 2005
Posts: 206
Thanks: 0
Thanked 20 Times in 20 Posts

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.


Old July 3rd, 2013, 06:37 AM
Registered User
Join Date: Jul 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

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;

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

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.