显示与原始密码字符数相同的虚拟密码文本

Display dummy password text with same number of characters as original password

我有一个编辑用户页面,我必须在其中显示一些用户详细信息,例如用户名、名字、姓氏...以及用户登录时使用的密码。 我正在使用 concrete5,所以我 无法 解密密码以便在密码字段中显示。(input type="password") 我必须显示一个虚拟密码字段,它应该具有与密码相同数量的字符。是否有任何想法生成与原始密码具有相同数量星号的密码字段。

我不会存储密码长度,这不是一个很好的安全决定,而是使用静态长度。以下是如何使用占位符在不泄露密码长度的情况下为用户提供良好体验的几个示例:

<p>Use a static length password representation</p>
<input type="password" name="password" placeholder="*************"><br>
<input type="password" name="password" placeholder="*************"><br>
<input type="password" name="password" placeholder="*************"><br>

<p>Use prompts for the passwords instead</p>
<input type="password" name="password" placeholder="Current Password"><br>
<input type="password" name="password" placeholder="New Password"><br>
<input type="password" name="password" placeholder="Confirm New Password"><br>

<p>Or just leave them blank (assuming they already have labels)</p>
<input type="password" name="password"><br>
<input type="password" name="password"><br>
<input type="password" name="password"><br>