This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need coding help

 
Rajesh kannan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to code encryption/decryption in a java based client server application. [I am new to client/server programming]

I have a swing client which takes user id and password. On the client side, I have another class, client.java which can take userid/password and do encryption.
Now, I have to do decryption. How do I call the server side class ?
Also, we have to have this done by des.

Can anyone give me code samples for des encryption/decryption using Java ?

Thanks
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.coderanch.com/t/377730/java/java/Encryption-client-server-data
 
Rajesh kannan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marc,


I would prefer to have a DES implementation for my encryption/decryption..

Any ideas..
 
Horatio Westock
Ranch Hand
Posts: 221
 
Rajesh kannan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,

I already saw this example. But this example still uses Base64 type of encoding,

See this line:
return new sun.misc.BASE64Encoder().encode(enc);

I want to avoid using base64 encoding/decoding.

Any thoughts ?
 
Horatio Westock
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, as long as you don't mind passing around a byte array, you can skip the base64 encoding/decoding. You just need to alter those methods slightly to accept as a parameter/return a byte[].

Just depends upon how you want to use the data you are working with. For example, writing to an XML file you might want it base64 encoded, passing to another method or somesuch then a byte[] would be fine.
 
Rajesh kannan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

Basically I want to pass in id/password, encrypt them, send to the server.

In server, id/password will be decrypted and I would like to convert byte[] to String...
 
Rajesh kannan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Horatio,

AS I mentioned before, I would like to return a String.
How can I return a string without using base64 encoder/decoder ? Our company stays away from base 64 encodier/decoder.

Any help...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic