title: Yii2 Username and password encryption
body: <p>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 <code>\yii\helpers\Security::encrypt($data, $secretKey)</code> will encrypt the data and similiary we can decrypt it. But how to use it in a view like login form?</p>
  
  <p>This is my login form</p>
  
  <pre><code>    &lt;?php $form = ActiveForm::begin(['id' =&gt; 'login-form']); ?&gt;
      &lt;?= $form-&gt;field($model, 'username') ?&gt;
      &lt;?= $form-&gt;field($model, 'password')-&gt;passwordInput() ?&gt;
      &lt;div class="form-group"&gt;
      &lt;?= Html::submitButton('Login', ['class' =&gt; 'btn btn-info']) ?&gt;
      &lt;/div&gt;
      &lt;?php ActiveForm::end(); ?&gt;
  </code></pre>
  
  <p>How to handle the encryption of user entered data here?</p>