Trusted answers to developer questions

What is bcrypt in PHP?

Get Started With Machine Learning

Learn the fundamentals of Machine Learning with this free course. Future-proof your career by adding ML skills to your toolkit — or prepare to land a job in AI or Data Science.

In this shot, we will go over a plain text explanation of bcrypt.

$password = bcrypt('secret');

Overview

bcrypt is a hashing calculation that is adaptable with equipment through a configurable number of rounds. The slowness and multiple rounds of bcrypt ensures that hackers use gigantic stores and equipment to be able to decipher passwords.

Phases of bcrypt

The bcrypt calculation runs in two phases:

  • In the primary stage, EksBlowfishSetup is called with the fetched, salt, and watchword to initialize eksblowfish's state. Most of bcrypt's time passes through within the costly key plan.

  • After that, the 192-bit esteem OrpheanBeholderScryDoubt is scrambled 64 times with eksblowfish in ECB mode with the state from the previous stage. The yield is the taken toll and 128-bit salt concatenated with the result of the encryption loop.

In spite of the fact that we cannot formally demonstrate bcrypt E-secure, any imperfection would likely bargain a genuine blow to the well-studied blowfish encryption algorithm.

Please refer to this shot on the “Basics of Hashing” for more information on this topic.

RELATED TAGS

php

CONTRIBUTOR

Chinweuba Elijah Azubuike
Did you find this helpful?