DES in java  
Author Message
wazary





PostPosted: 2005-9-14 17:58:00 Top

java-programmer, DES in java Hi,
I need to write a method in Java for
encrypt a String with DES.
the interface is:
public String encrypt(String nameofthestringtoencript);
the return String have to be DES(nameofthestringtoencript)
What is the procedure to follow and the java methods
to do it?
Thanks in advance.


 
jan V





PostPosted: 2005-9-14 18:15:00 Top

java-programmer >> DES in java > I need to write a method in Java for
> encrypt a String with DES.
> the interface is:
> public String encrypt(String nameofthestringtoencript);

How odd... you'd expect the name of that parameter to be
"thestringtoencript", not "nameofthestringtoencript". Can you discuss with
your tutor (for extra points ;-)

> the return String have to be DES(nameofthestringtoencript)
> What is the procedure to follow and the java methods

Depends on which JDK you carry out your exercises. The solution could get
low-level if you're on a pre-1.4 platform.

Does the Java Tutorial not have a section on the security API?

Or maybe the Java Almanac...
http://javaalmanac.com/egs/javax.crypto/PassKey.html


 
Roedy Green





PostPosted: 2005-9-14 18:24:00 Top

java-programmer >> DES in java On Wed, 14 Sep 2005 09:58:20 GMT, "wazary" <email***@***.com> wrote or
quoted :

>I need to write a method in Java for
>encrypt a String with DES.
>the interface is:
>public String encrypt(String nameofthestringtoencript);
>the return String have to be DES(nameofthestringtoencript)
>What is the procedure to follow and the java methods
>to do it?
>Thanks in advance.

see http://mindprod.com/jgloss/jce.html
http://mindprod.com/jgloss/encryption.html

I suggest getting a textbook. Trying to use the API without a guide is
daunting.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.