Prevent user to find password through Firebug/Chrome Dev Tools

后端 未结 13 1177
醉梦人生
醉梦人生 2020-12-30 22:28

\"Hidden

For the passport input field:



        
13条回答
  •  南方客
    南方客 (楼主)
    2020-12-30 23:23

    Short answer: It can not be prevented, unfortunately. This is because all client-side code (JavaScript) is modifiable by the client itself - thus making a client-based security system vulnerable.

    The only workable solution I can think of, is to store a hashed representation of the password, instead of the raw password. This will (if you disregard hash-bruteforce attacks) keep the raw password safe.

    A hash is a representation of the original text, and is non-reversable. That is, the original string of characters can not be retrieved by any algorithm, using only the hash. Examples of hash' is MD5 and SHA. This technique is commonly used in routers, where password often is stored in the browser.

    Clarification: Never store your passwords in plain-text, and if you want to adopt this technique of pre-entered password; the hashing and/or encryption must occur on server side.

提交回复
热议问题