Back

Issue upgrading to Laravel 4.2 Beta 1


nateajohnson posted 4 years ago

In the upgrade guide it mentions this:

--

Encryption Defaults

Add a new cipher option in your app/config/app.php configuration file. The value of this option should be MCRYPT_RIJNDAEL_256.

'cipher' => MCRYPT_RIJNDAEL_256 This setting may be used to control the default cipher used by the Laravel encryption facilities.

--

After setting this I get the following error when I try to access any page in my app:

ErrorException mcrypt_decrypt(): The IV parameter must be as long as the blocksize project/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php

Anyone else seeing this issue or know how to fix it?

Thanks, Nate

zocheyado replied 4 years ago

I am having this issue as well but in the reverse, Originally started using 4.2 and now I am trying to downgrade to 4.1.18 for compatability and I am getting this same error.

mhuxain replied 4 years ago Solution

Had the same problem.

Solved by generating new key for the app. see http://laravel-recipes.com/recipes/283.

NOTE / WARNING: it says that by generating new keys "that passwords saved with Hash::make() will no longer be valid." But for me, the password still works, i'm just testing the framework so it might be different i guess.

barryvdh replied 4 years ago

Hash::make() doesn't use the key, only Crypt::encrypt/decrypt. And the cookies I think. Clearing the cookies usually helps, or try clearing you storage cache.

barryvdh replied 4 years ago

Hash::make() doesn't use the key, only Crypt::encrypt/decrypt. And the cookies I think. Clearing the cookies usually helps, or try clearing you storage cache. MCRYPT_RIJNDAEL_256 should be the same as in 4.1, if you don't set it, it will default to MCRYPT_RIJNDAEL_128 (the more 'approved' standard)

nateajohnson replied 4 years ago

Thanks all. And like @barryvdh said, Hash::make() does not use the key so passwords continue to work.

nicekiwi replied 4 years ago

mhuxain said:

Had the same problem.

Solved by generating new key for the app. see http://laravel-recipes.com/recipes/283.

NOTE / WARNING: it says that by generating new keys "that passwords saved with Hash::make() will no longer be valid." But for me, the password still works, i'm just testing the framework so it might be different i guess.

Someone needs to add this to the release notes or upgrade guide if/when it is created. :)

I upgraded from 4.1.* - Save error.

kwolniak replied 4 years ago

What if I use Crypt class in different places, and now when i try Crypt::decrypt() i get an error? I did the upgrade from version 4.1.30 to 4.2.1.

'ErrorException' with message 'mcrypt_decrypt(): The IV parameter must be as long as the blocksize' in /vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php:112

What must I do now to avoid having to encrypt the data again?

thaifood replied 4 years ago

Same problem here. Help

barryvdh replied 4 years ago

Did you add the MCRYPT_RIJNDAEL_256 cipher to the app/config/app.php file as mentioned in the upgrade guide?

stefanX201 replied 4 years ago

i did everythink like in the upgrade guide but i get still an

php artisan serve
Laravel development server started on http://localhost:8000
// AFTER first Request attemption server halt with
Segmentation fault

error. i cleaned up my base route like tat

Route::get('/', function() { });

vivekiran replied 4 years ago

Clear the browser cache and storage folder. It should work fine.

stefanX201 replied 4 years ago

vivekiran said:

Clear the browser cache and storage folder. It should work fine.

nope that wasnt the problem. Dont know why but i switch to a vagrant box (Homestead) and now it works.

anyway, thanks


Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us