Laravel 5 – SHA1 encryption instead of BCrypt

Recently I have migrated core PHP application to the Laravel5 framework. The old application used SHA1 encryption so I have implemented Hashing contracts of laravel5 to use SHA1 instead of BCrypt.

SHA1 encryption instead of BCrypt

Create Directories in app called “Libraries\ShaHash” and create a file called SHAHasher.php and place below code in it.

Then create a service provider class(App\Providers) file called ShaHashServiceProvider.php and register your service as shown below.

Then add our new service provider to providers array in config/app.php. and also remove default hash provider.

That is it.

By Arjun

I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.

1 reply on “Laravel 5 – SHA1 encryption instead of BCrypt”

Leave a Reply

Your email address will not be published. Required fields are marked *