8

I ran composer update on a Laravel application, and now I am getting this error:

mcrypt_decrypt(): The IV parameter must be as long as the blocksize

What happened?!

Kousha
  • 32,871
  • 51
  • 172
  • 296
  • cool [Ed Rands's comment][1] worked for me just to clean up the cookies [1]: http://stackoverflow.com/a/23922994/1539590 – JaydenLiu Nov 21 '14 at 17:54

4 Answers4

26

I figured this out. All you have to do is clear your cookies, and everything will be A-okay!

Ed Rands
  • 911
  • 12
  • 19
Kousha
  • 32,871
  • 51
  • 172
  • 296
  • 2
    You only need to clear the cookies, not the history. – Mario Campa Jun 05 '14 at 13:57
  • I've got the same problem... It happens when multiple laravel sessions are opened in the same browser (It happened with firefox). I've removed `pma_*` and `laravel_session` cookies and everything went back to normal – IlGala Dec 22 '15 at 18:18
4

You need to change your cipher at app\config\app.php. Having same cipher name was causing that problem for me. I changed the cipher name uniquely & then it worked fine.

user2432443
  • 147
  • 2
  • 11
2

This problem can also happen when you run more than one Laravel project/app with same Encryption Key. Just change key value in app/config/app.php with different value and you ready to go.

Ifan Iqbal
  • 3,053
  • 5
  • 28
  • 31
  • This should really be the accepted answer imo as it tackles the problem from the right angle - eliminating dual Laravel keys - rather than bypassing it. – Volzy Oct 12 '15 at 13:28
2

Just elaborating on the answer from Ifan Iqbal. As he says this happens when running several Laravel installations with the same encryption key. Instead of clearing your cookies, simply create a unique key for each Laravel install you run (good practice by the way).

Go to your terminal and put:

php artisan key:generate

This will automatically set the encryption key in app/config/app.php and your error will go away.

Volzy
  • 225
  • 1
  • 9