Java – Hide password content in source code

Who knows how to hide the password content in the source code of j2me program? That is, people cannot regard "DBT" as the password to read the source code

public void validateUser(String user,String Password) {     
  if (user.equals("N0203251") && Password.equals("DBT")) {
    switchDisplayable(null,getContinue());
  }
}

Solution

As others say Store hashing values, but you still need to use a strong password or auto guess will find the password you are using

However, please note:

If your attacker has access to the source code, he / she / it can change the stored password hash value or just delete the password check

Therefore, unless you can verify the integrity of the running code, this method is almost useless, which is difficult

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>