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 August 20th, 2007, 09:22 AM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default PBE

I'm working my way through the PBE example PBEWithParamsExample on pp 46-47 of Cryptography with Java. This class seems fubar (which is probably from my mis-understanding).

1. why is the hardcoded 'password' the only value that allows this example to work. It doesn't seem to correspond to any of the byte arrays (which I was guessing might be the connection).
2. Why do you encrypt with pre-calculated keys but decrypt with a key based off a password. It would make more sense to generate a synch key off of a password and then have to know the password to use the same key to decrypt the message. However, I'm sure there is something I'm missing.


Bryan
 
Old August 21st, 2007, 01:14 AM
dgh dgh is offline
Wrox Author
 
Join Date: Aug 2005
Posts: 206
Thanks: 0
Thanked 20 Times in 20 Posts
Default

With 1. the array keyBytes is the precomputed PKCS#12 key that the password, salt, and iteration count in the second half of the example produce.

With 2. it's to demonstrate what PKCS#12 PBE does under the covers - it takes the password, salt and iteration count and an internal key which is the same value as keyBytes.

Regards,

David






Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic PBE - Password Interpretation AndyN BOOK: Beginning Cryptography with Java 1 August 11th, 2006 08:45 AM





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