<i id='HE6kf'><tr id='HE6kf'><dt id='HE6kf'><q id='HE6kf'><span id='HE6kf'><b id='HE6kf'><form id='HE6kf'><ins id='HE6kf'></ins><ul id='HE6kf'></ul><sub id='HE6kf'></sub></form><legend id='HE6kf'></legend><bdo id='HE6kf'><pre id='HE6kf'><center id='HE6kf'></center></pre></bdo></b><th id='HE6kf'></th></span></q></dt></tr></i><div id='HE6kf'><tfoot id='HE6kf'></tfoot><dl id='HE6kf'><fieldset id='HE6kf'></fieldset></dl></div>

  • <legend id='HE6kf'><style id='HE6kf'><dir id='HE6kf'><q id='HE6kf'></q></dir></style></legend>
  • <small id='HE6kf'></small><noframes id='HE6kf'>

    <tfoot id='HE6kf'></tfoot>

          <bdo id='HE6kf'></bdo><ul id='HE6kf'></ul>
      1. Yii2 用户名密码加密

        时间:2023-10-15

            <i id='P6Xls'><tr id='P6Xls'><dt id='P6Xls'><q id='P6Xls'><span id='P6Xls'><b id='P6Xls'><form id='P6Xls'><ins id='P6Xls'></ins><ul id='P6Xls'></ul><sub id='P6Xls'></sub></form><legend id='P6Xls'></legend><bdo id='P6Xls'><pre id='P6Xls'><center id='P6Xls'></center></pre></bdo></b><th id='P6Xls'></th></span></q></dt></tr></i><div id='P6Xls'><tfoot id='P6Xls'></tfoot><dl id='P6Xls'><fieldset id='P6Xls'></fieldset></dl></div>
            <tfoot id='P6Xls'></tfoot>

                <bdo id='P6Xls'></bdo><ul id='P6Xls'></ul>
                  <tbody id='P6Xls'></tbody>

              • <legend id='P6Xls'><style id='P6Xls'><dir id='P6Xls'><q id='P6Xls'></q></dir></style></legend>

                1. <small id='P6Xls'></small><noframes id='P6Xls'>

                  本文介绍了Yii2 用户名密码加密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  几天前我扫描了我的 yii2 应用程序,并注意到登录表单中的用户名和密码是在没有任何加密的情况下发布的.我怎样才能让我的用户名和密码更安全?我知道 yiihelpersSecurity::encrypt($data, $secretKey) 会加密数据,我们也可以解密.但是如何在像登录表单这样的视图中使用它?

                  这是我的登录表单

                    'login-form']);?><?= $form->field($model, 'username') ?><?= $form->field($model, 'password')->passwordInput() ?><div class="form-group"><?= Html::submitButton('登录', ['class' => 'btn btn-info']) ?>

                  <?php ActiveForm::end();?>

                  这里如何处理用户输入数据的加密?

                  解决方案

                  正如 Sisko78 在其评论中声称的那样,客户端的散列密码在安全性方面没有太大帮助,但可以做到很多危害(如果有人在他们的浏览器中完全使用 Javascript,他们通常会被搞砸,因为您的服务器将无法正确处理未散列的数据).

                  我在这个问题上问了非常相似的问题,并得到了这个很好的答案.一般来说:

                  <块引用>

                  从攻击者的角度来看,无论您发送纯文本密码还是 MD5 哈希,都没有太大区别 (...)

                  这个答案包括对 MD5 哈希的引用,因为我是专门针对这个问题询问的.但是,它与 MD5 现在被视为非常不安全的事实没有任何关系.就您的(我的)问题而言,使用任何类型的客户端密码都与根本不散列密码一样不安全.而且唯一真正安全的选择是使用 HTTPS 协议.阿门.

                  I had scanned my yii2 application few days before and noted that username and passwords from the login form is posting without any encryption. How can i make my username and password more secure?I know yiihelpersSecurity::encrypt($data, $secretKey) will encrypt the data and similiary we can decrypt it. But how to use it in a view like login form?

                  This is my login form

                      <?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
                      <?= $form->field($model, 'username') ?>
                      <?= $form->field($model, 'password')->passwordInput() ?>
                      <div class="form-group">
                      <?= Html::submitButton('Login', ['class' => 'btn btn-info']) ?>
                      </div>
                      <?php ActiveForm::end(); ?>
                  

                  How to handle the encryption of user entered data here?

                  解决方案

                  As Sisko78 claims in its comment, hashing password on client side won't do much help in terms of security, but can do a lot of harm (if someone turns of Javascript at all in their browser, they're generally screwed, as your server won't be able to correctly process not hashed data).

                  I have asked very similar question on this matter and was given this great answer. In general:

                  From the attacker's standpoint, whether you send a plain text password or a MD5 hash or it doesn't make much difference (...)

                  This answer includes reference to MD5 hash, because I asked specifically for this one. But, it does not have any relation to the fact, that MD5 is now treated as very insecure. In terms of your (mine) question, using any kind of client-side password hasing is as insecure as not hashing password at all. And the only really secure option is to use HTTPS protocol. Amen.

                  这篇关于Yii2 用户名密码加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 url 创建 yii2 动态页面:www.example.com/pageName 下一篇:试图在 yii2 中获取非对象的属性

                  相关文章

                  <small id='EaLEg'></small><noframes id='EaLEg'>

                  1. <tfoot id='EaLEg'></tfoot>

                      <legend id='EaLEg'><style id='EaLEg'><dir id='EaLEg'><q id='EaLEg'></q></dir></style></legend>
                        <bdo id='EaLEg'></bdo><ul id='EaLEg'></ul>

                    1. <i id='EaLEg'><tr id='EaLEg'><dt id='EaLEg'><q id='EaLEg'><span id='EaLEg'><b id='EaLEg'><form id='EaLEg'><ins id='EaLEg'></ins><ul id='EaLEg'></ul><sub id='EaLEg'></sub></form><legend id='EaLEg'></legend><bdo id='EaLEg'><pre id='EaLEg'><center id='EaLEg'></center></pre></bdo></b><th id='EaLEg'></th></span></q></dt></tr></i><div id='EaLEg'><tfoot id='EaLEg'></tfoot><dl id='EaLEg'><fieldset id='EaLEg'></fieldset></dl></div>