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 June 5th, 2011, 10:20 PM
Authorized User
 
Join Date: Jun 2011
Posts: 38
Thanks: 9
Thanked 0 Times in 0 Posts
Default PKCS5Scheme1Test Java Code?

it would be more accurate to say-

Code:
Cipher           cipher = Cipher.getInstance("PBEWithSHA1AndDES","BC");

cipher = Cipher.getInstance("DES/CBC/PKCS5Padding", "BC");

instead of

cipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
This is because the encrypt cipher has specified the BC provider, but the decrypt cipher hasn't specified BC provider. JCA implementation could use other provider which comes higher in precedence, in such cases input and plain could be different.
 
Old June 6th, 2011, 12:47 AM
dgh dgh is offline
Wrox Author
 
Join Date: Aug 2005
Posts: 206
Thanks: 0
Thanked 20 Times in 20 Posts
Default

No, the two will be the same. This is also one of the points of the example.

Regards,

David





Similar Threads
Thread Thread Starter Forum Replies Last Post
PKCS5Scheme1Test? boy18nj BOOK: Beginning Cryptography with Java 1 June 19th, 2011 06:48 PM
Java script code kethireddy435 Javascript 1 July 30th, 2008 01:50 PM
Java Script from code behind jagdishnc ASP.NET 1.0 and 1.1 Basics 0 January 22nd, 2008 06:37 AM
Java Code - Wrox - Beginning JAVA - Ivor Horton ponguru Java Databases 3 May 18th, 2006 12:30 PM
Java code problem Loevet J2EE 5 October 23rd, 2003 08:42 AM





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