Java AES encryption and decryption

后端 未结 6 1406
独厮守ぢ
独厮守ぢ 2020-12-07 15:48

I would like to encrypt and decrypt a password using 128 bit AES encryption with 16 byte key. I am getting javax.crypto.BadPaddingException error while decrypt

6条回答
  •  情话喂你
    2020-12-07 16:26

    You state that you want to encrypt/decrypt a password. I'm not sure exactly of what your specific use case is but, generally, passwords are not stored in a form where they can be decrypted. General practice is to salt the password and use suitably powerful one-way hash (such as PBKDF2).

    Take a look at the following link for more information.

    http://crackstation.net/hashing-security.htm

提交回复
热议问题