Java encryption alternitive to hardcoded key

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

    the most secure method is not use any encryption, just put your user.properties to your home directory, with following code:

    String userhome = System.getProperty("user.home");
    String username = system.getProperty("user.name");
    String hostname = java.net.InetAddress.getLocalHost().getHostName();
    
    if (hostname.equals("webserver") && username.equals("root")){
    ResourceBundle user = ResourceBundle.getBundle(userhome/ "user.properties");
    }
    

提交回复
热议问题