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 a开发者_如何学编程nd 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?
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.
精彩评论