开发者

What algorithm can I use for encryption in Java?

What algorithm can I use for creating an encryption program in Java? What if I want to use the same key for encrypting and decrypting?

Example: I type Hello world and use the key guy, so the words change into xgdsts@dtoll. If I want to decrypt it, I have to use the same key(guy) so it'll become hello world 开发者_运维问答again


You could use AES.


You can use any algorithm you want, if you're willing to implement it. If you're asking what algorithms Java provides, the cryptography extension offers (from this list):

  • AES
  • Blowfish
  • DES
  • DESede
  • RC2, RC4, RC5
  • RSA

I believe all those are symmetric (the encryption and decryption key is the same) except for RSA


Take a look at the Java Cryptography Extension. Here's a simple example.


I would stick to the industry standards - Triple-DES (3DES) or AES, whereby 3DES is slowly being replaced by AES. Libraries and source code for various languages are available, tested and validated.

I would use random generated keys for data encryption, and distribute these keys using asymetric methods (RSA) based on public/private key pairs.


You can use any symmetric key algorithm

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜