Java encryption alternitive to hardcoded key

前端 未结 8 731
刺人心
刺人心 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: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.

提交回复
热议问题