Simple Data encryption

Hi

I hope someone can help me I have a simple client server progam. The client is C++ running on windows and the server is Java. I want to encrypt data on the client send it to the server and decrypt it. Is there a simple way of doing this or do I have to have go the full monty wih key exchange etc. If so how do I get the "key" into windows using the API's as I can't see away of doing it.

Thanks

[419 byte] By [keyan01a] at [2007-10-2 9:53:02]
# 1

> I hope someone can help me I have a simple client

> server progam. The client is C++ running on windows

> and the server is Java. I want to encrypt data on the

> client send it to the server and decrypt it. Is there

> a simple way of doing this or do I have to have go

> the full monty wih key exchange etc. If so how do I

> get the "key" into windows using the API's as I can't

> see away of doing it.

Use public key encryption.

Of course you have to do some key exchange! How else do you plan to encrypt values?!?

The server will need a certificate containing its public key. The client will contact the server which will return the certificate. The client should verify the certificate and then use the public key to encrypt the message. This message can now be sent to the server. The server can decrypt the message using its private key.

_bensmytha at 2007-7-16 23:57:57 > top of Java-index,Security,Other Security APIs, Tools, and Issues...
# 2

No you don't need to exchange keys - public keys are just 1 way. There are many ways of encrypting data and for simple encryption you can just decide a specific key that both of your apps know (e.g. a special string). Then encrypt and decrypt your messages on both sides with the same key and the same algorithm.

MartinHilperta at 2007-7-16 23:57:57 > top of Java-index,Security,Other Security APIs, Tools, and Issues...
# 3

> There are many ways of encrypting data

> and for simple encryption you can just decide a

> specific key that both of your apps know (e.g. a

> special string). Then encrypt and decrypt your

> messages on both sides with the same key and the same

> algorithm.

This is known as symmetric, whereas my previous approach is asymmetric.

I proposed asymmetric in this case since the OP suggests a client-server relationship. Under the assumption that there are many clients and you don't want the hassle of key distribution asymmetric makes sense. (You could of course use public key [asymmetric] to establish a session key [symmetric]).

The best advice I can give, at this stage, is to read about it!

wikipedia is a fantastic resource.

_bensmytha at 2007-7-16 23:57:57 > top of Java-index,Security,Other Security APIs, Tools, and Issues...