Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > BOOK: Beginning Cryptography with Java
|
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 March 26th, 2007, 10:25 AM
Registered User
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to asheeshm
Default Basic Utility Hex and Bit wise Operator

This book presents an interesting reading.
Since its a beginners book an explanation of what's happening in the chapter2.Utils toHex() makes sense.

can somebody explain me
1. Why everything is Hex ?
2. What's the use of data[i[ & 0xff;
3. v >> 4 ?
4. v & 0xf?

and what's the value addition this method is doing ..

Once again this is a beginners question.
 
Old March 26th, 2007, 06:56 PM
dgh dgh is offline
Wrox Author
 
Join Date: Aug 2005
Posts: 206
Thanks: 0
Thanked 20 Times in 20 Posts
Default

Fair enough, although these are mostly Java questions.

In answer:

>1. Why everything is Hex
      it's the easiest way to represent the data, bytes of encrypted data cannot be generally represented as Strings.

>2. What's the use of data[i] & 0xff?
      bytes in Java are signed, the "& oxff" is required to make sure the resulting int is in the range 0 to 255.

>3. v >> 4
      gives the high nibble (4 bits) of the byte, indexed into digits giving the matching character.

>4. v & 0xf
      gives the low nibble of the byte, indexed into digits giving the matching character.

> what's the value addition this method is doing

Sorry, don't understand this question at all. If you're referring to the StringBuffer class append() method you can find the details in the StringBuffer JavaDoc.

Regards,

David

 
Old March 27th, 2007, 12:21 AM
Registered User
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to asheeshm
Default

Thanks David for quick response.

You have written a wonderful as far as depth and coverage is concerned. Hats Off. However, it can be made easy to read by including details of some basic non common operations like the one mentioned in my query.

My further question is why bytes of encrypted data can not be represented as string. Why hexadecimal is better. Why are we using 4 bits for one Hexa character etc.

May be we can include a small intro. in the main text or a small appendix at the back.

For example I am finding it difficult to understand the use of Cipher class. You have explained Cipher class,how its created and its API. I do not understand what is Cipher providing.

That way I find Oreilly books easier to read.

I love this book, but when it comes to readability I find it confusing.

Are you planning a second edition of this book in near future.

 
Old March 27th, 2007, 01:51 AM
dgh dgh is offline
Wrox Author
 
Join Date: Aug 2005
Posts: 206
Thanks: 0
Thanked 20 Times in 20 Posts
Default

With the use of Hex, it guarantees that the data is represented in printable characters - being a book it makes it rather difficult to print sample data otherwise.

There's no plans for a new edition at the moment.

Regards,

David






Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid operator for data type. Operator equals di Pusstiu SQL Server 2000 2 August 10th, 2007 04:51 AM
convert byte[] to hex wkm1925 C# 1 December 14th, 2006 09:07 PM
hex num changed.. life_s Ng ASP.NET 2.0 Professional 1 October 30th, 2006 12:41 PM
Select where hex aliali SQL Server 2000 5 October 16th, 2006 11:39 PM
64 Bit - Issue in 64 bit IIS calling Win32 API Hubman General .NET 1 August 24th, 2006 09:19 AM





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