Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / April 2004

Tip: Looking for answers? Try searching our database.

DES Encryption

Thread view: 
Smegly - 08 Apr 2004 07:32 GMT
Hi,

I'm trying to implement the DES encryption in Java. I have a couple of
concerns at the moment. The first is if I am importing a text file
how do i implement this in a binary or hexidecimal format. I've looked
through the api specifications but am not sure how to go about
it.

Secondly, I'm thinking of using the bigInteger class in order to implement
left shifts towards the end of the algorithm. Is this viable, as it
has a left shift method already included .. or is there a simpler way . .??

Any help would be appreciated ..

Kind Regards,

Matt
Roedy Green - 08 Apr 2004 08:09 GMT
>I'm trying to implement the DES encryption in Java. I have a couple of
>concerns at the moment. The first is if I am importing a text file
>how do i implement this in a binary or hexidecimal format. I've looked
>through the api specifications but am not sure how to go about
>it.

try asking in comp.lang.java.security.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Daniel Sjöblom - 08 Apr 2004 17:58 GMT
> Hi,
>
[quoted text clipped - 3 lines]
> through the api specifications but am not sure how to go about
> it.

Your question doesn't make sense as it is formulated. All you have in
your computer is bits. Text files consist of bits, just like executable
files consist of bits. DES works on 64 bit chunks of data, or 8 bytes.
Just treat everyhing as bytes and you'll be ok.

> Secondly, I'm thinking of using the bigInteger class in order to implement
> left shifts towards the end of the algorithm. Is this viable, as it
> has a left shift method already included .. or is there a simpler way . .??

The shift operators work on the built in types (namely int and long).

<< left shift
>> right shift
>>> unsigned right shift

and same as assignment

<<=
>>=
>>>=

There is no point in using BigInteger. It will be very slow. You can get
along with normal ints since IIRC, most of the operations are done on
halves of the 64 bit key.
Signature

Daniel Sjöblom
Remove _NOSPAM to reply by mail



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.