Cheetah
Cheetah

Reputation: 14431

Private key encryption method wanted

I am programming some server-client software and wanted some encryption. Both the server and client share a private key which is fixed length. Haven't decided what length I am going to have the key, but I do know that the key will be between 1 and 32 characters. The key is predetermined (so for instance I may decide I want the key to be abc1234)

I am programming in Java and need the algorithm to be a quick as possible as the clients are most likely to be mobile devices. I don't need any compression but I would prefer if the encrypted string wasn't larger.

I am not looking for top-notch encryption here obviously, but it is my understanding that any key based encryption can't be broken without knowledge of the private key anyway.

Can anyone recommend me an algorithm/method for encryption/decryption with a shared private key?

Upvotes: 1

Views: 489

Answers (1)

QuantumMechanic
QuantumMechanic

Reputation: 13946

it is my understanding that any key based encryption can't be broken without knowledge of the private key anyway

That's not even close to true. A lousy algorithm absolutely can be broken without knowledge of the private key.

Anyhow, if there's a shared key, consider AES.

And read up on the JCE/JCA as Java can do AES and other types of encryption out of the box. Much better than rolling your own.

Upvotes: 3

Related Questions