Java encryption alternitive to hardcoded key

前端 未结 8 725
刺人心
刺人心 2021-02-08 13:42

I am new to encryption.

I have looked at the javax.crypto documentation and got encryption of a file to work using this code ...

File saveFile = new File         


        
相关标签:
8条回答
  • 2021-02-08 14:29

    I do not believe that this is possible without having the user entering the key on encryption and decryption.

    You could employ some technique to make it harder to view the key without the full source code, but it would not be secure.

    0 讨论(0)
  • 2021-02-08 14:34

    Is it important that the user not be able to see his own encryption key? Or merely important that by discovering his won key, the user should not thereby know everyone else's key?

    You could prompt the user for a personal key and either store it externally or prompt the user each time you need it. That way each user's key would be his own, and would not be usable to decrypt documents stored by other users on other machines.

    0 讨论(0)
提交回复
热议问题