在源代码中隐藏密码内容 [英] Hide Password Content in Source Code

查看:169
本文介绍了在源代码中隐藏密码内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何在j2me程序的源代码中隐藏密码内容吗?也就是说,阅读源代码的人不会看到"DBT"作为密码.

Does anyone know how to hide the password contents in the source code of a j2me program? i.e. so people cannot see "DBT" as password who read the source code.

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

推荐答案

正如其他人所说.存储哈希,尽管您仍然需要使用强密码,否则自动猜测器会找到您正在使用的哈希.

As other have said. Store the hash, though you still need to use a strong password or an automated guesser will find the one you're using.

但是,请注意

如果您的攻击者可以访问源代码,则他/她/它可以更改存储的密码哈希或仅删除密码检查.

If your attacker has access to the source code he/she/it can alter the stored password hash or just remove the password check.

因此,除非您可以验证正在运行的代码的完整性(即 hard .),否则此方法几乎没有用.

So this method is of little use unless you can verify the integrity of the code being run, which is hard.

这篇关于在源代码中隐藏密码内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆