title: Laravel - DecryptException: 'The MAC is invalid'
body: <p>In laravel for registration I'm using encrypt algorithm for password instead of inbuilt bcrypt function in Laravel because to get password and send it to mail when password is forgot.</p>
  
  <p>But decrypt it is showing a error like </p>
  
  <pre><code>DecryptException The MAC is invalid in Encrypter.php (line 184)
  </code></pre>
  
  <p>This , when I run this code it is working on local but server itself it is not working below i have mentioned the code , can anyone please help</p>
  
  <pre><code>public function forgotpassword(Request $request)
  {
    $email=$request-&gt;email;
    $selectemail = User::select('email','password','name')
       -&gt;where('email',$email)
       -&gt;first();     
  
    if($selectemail)                       
    {                                 
      $password=decrypt($selectemail-&gt;password);
      $data = array( 'email' =&gt; $selectemail-&gt;email,'password' =&gt; $password , 'name' =&gt; $selectemail-&gt;name);
  
      Mail::send('email.resetpassword',$data,function($message) use ($email)
      {
        $message-&gt;to([$email])-&gt;subject('Forgot Password Letgo');
      });
        echo "Mail has sent successfully";
    } else {
      echo "This email is not yet registered";
    }             
  }   
  </code></pre>