Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Further to last nights encryption question

Status
Not open for further replies.

relisys

Programmer
Mar 6, 2003
65
GB
Does anyone know if i can take an alphanumeric string to generate a DES key to encrypt data? It has to form the same key everytime so i can encrypt and decrypt the information....

Cheers!

Relisys
 
DES just works with bytes so it does not care what byte values are.

Did you try it? Did you recieve an error?

-pete

 
yeah had errors but corrected them i think

when i crease a key and print it out it becomes:
Key: -84-19051151140309911110946115117110469911412111211611146112114111118105100101114466869837510112110752-10053-382110
4-1042019103107101121116029166120112117114029166-84-1323-86884-322001201120008-387481-8847103-3697

(all one line of course)
I'm not sure if i can get toHexString as i'm using J2SDK1.3.1_02 with JCE1.2.2 and i think a lot of stuff was added from SDK1.4 onwards.

gives me standard cannot resolve sysmbol. I dont think what i'm trying to do is hard, just I've never attempted encryption before and i'm finding it hard going. Can't find many good guides online (thanks pete yours was a help yesterday as a beginning)
=====
>All i really need is to generate a random DES key and use that to encrypt plain text to ciphertext. I then load a 16character alphanumeric string and create a new DES key from that which i use to encrypt the first key. The resulting data i need to cast to a string (hopefully around 16-32 characters max), store half of it back into the database with the ciphertext and print the other half out.

That way i can use the printout combined with the other key data in the dabase and decrypt it again with the DES Key from the loaded 16character string. This should reform the original random DES key which was never saved and be able to decrypt the cipher text back to plain text.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top