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 / General / August 2006

Tip: Looking for answers? Try searching our database.

JCE and CryptoAPI

Thread view: 
schw - 14 Aug 2006 11:36 GMT
Hi

In my server app written in c++ I use Microsoft Crypto API with 3DES
algorithms  to encrypt/decode data. The API uses effective key length
of 21 bytes - 168 bits.

Now I am writting a client app in java that has to encrypt some data
before sending them over but I've noticed that the JCE uses 24 bytes
length keys - 192bits. This is as 3DES ignores every seventh bit so the
effective key length is 21 bytes long.

is there any other provider that uses same key length as Crypto API or
how could I write a procedure that converts 21 bytes into 24 bytes
adding 1 bit after every seven bits in the source? I am new to Java so
help would be much apreciated.

best regards,
schw
JPractitioner - 14 Aug 2006 21:07 GMT
Hi schw,
yes u could use padding..
say for example, in your case, u can pad extra 18 bytes to ur data
(with 0s maybe)
so it will be 42 bytes.

when the data is decrypted, u will have to clean-up the trailing pads.

U also might want to check the API for DES encryption with pading
mechanism.
http://java.sun.com/j2se/1.5.0/docs/guide/security/jce/JCERefGuide.html

u can see how the padding is done with
Cipher.getInstance("DES/ECB/PKCS5Padding");

HTH

> Hi
>
[quoted text clipped - 14 lines]
> best regards,
> schw
Thomas Weidenfeller - 15 Aug 2006 08:43 GMT
> Hi schw,
> yes u could use padding..
> say for example, in your case, u can pad extra 18 bytes to ur data
> (with 0s maybe)

And you could use real words like "you".


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.