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:26 AM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default CTRExample

pp 36 and 37.

I understand the SimpleCTRExample with the exception of the part detailing how the IV ending in 3 zeros and one byte tells me that I should limit my processing to data that is no more than 2^35 bytes. How does 0001 tell me that? Also, can anyone explain the pat about how the first 4 bytes of the IV determine the number of messages that can be encrypted?

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

In the example IV is divided into two sections - the first four bytes are a random number fulfilling the role of a tradition initialisation vector, the second 4 bytes start at 00000001 and are incremented as each byte is processed. If the counter gets to ffffffff adding one will set the counter bytes back to zero and add one to the first 4 bytes - thus cycling the counter. This can be a problem if the first 4 bytes are the same for two identical or similar messages (they look the same encrypted for the same key), likewise the cycling can introduce this problem if sections of the message stream are similar, consequently the safest approach is to only process messages within the range of the counter bytes (in this case 00000001 to ffffffff) and not re-use the IV bytes for other messages.

Regards,

David










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