Hide password content in source code

Does anyone know how to hide the password contents in j2me source code? that is, people cannot see "DBT" as the password that reads the source code.

public void validateUser(String user, String Password) {     
  if (user.equals("N0203251") && Password.equals("DBT")) {
    switchDisplayable(null, getContinue());
  }
}
+3
source share
6 answers

As others said. Keep the hash, although you still need to use a strong password, or automatic guessing will find the one you are using.

But be careful:

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

Thus, this method is of little use if you cannot verify the integrity of the executable code, which is difficult.

+6

(MD5/SHA1) .

, , .

+3

, . - .

, , , . - , . , , , . , - , .

, , , , . - , , .

+3

, - , .

:

- . , , . , , . .

+1

, , , . - (, SHA1) , PBKDF2, , .

0

. , ( ) .

. - , , , . , , , , .

-1

Source: https://habr.com/ru/post/1726988/


All Articles