current location: Home > download site > Library download > Encryption and decryption class library > passwordPHP5.5 password PHP library
passwordPHP5.5 password PHP library
Classify: Library download / Encryption and decryption class library | Release time: 2017-12-19 | visits: 5561 |
Download: 204 |
Latest Downloads
Fantasy Aquarium
Girls Frontline
Wings of Stars
Little Flower Fairy Fairy Paradise
Restaurant Cute Story
Shanhe Travel Exploration
Love and Producer
The most powerful brain 3
Odd Dust: Damila
Young Journey to the West 2
24 HoursReading Leaderboard
- 1 Why Does Using `mysqli_fetch_array()` Multiple Times Cause Issues With Result Sets?
- 2 dialerres.dll - What is dialerres.dll?
- 3 dlcjdr5c.dll - What is dlcjdr5c.dll?
- 4 WAND Project release date introduction
- 5 Why Am I Getting \"Unexpected Semicolon or Newline Before Else\" in Go?
- 6 dlcres0804.dll - What is dlcres0804.dll?
- 7 How to Detect Green Objects in Images with OpenCV: A Step-by-Step Guide Using HSV Color Space?
- 8 How Can I Detect and Handle Viewport Orientation for Optimal Page Viewing on Mobile Devices?
- 9 What are the build systems compatible with the Go programming language?
- 10 To Open or To Close: When Should You Manage Your Database Connection?
- 11 dlbkdr5c.dll - What is dlbkdr5c.dll?
- 12 How to Create Stored Procedures in phpMyAdmin without Changing the Delimiter?
- 13 Why Am I Getting an Interface Conversion Error When Parsing Serpwow API Response?
- 14 djpeta.exe - What is djpeta.exe?
- 15 Can I Delete Output Generated by `System.out.println()` in Java?
Latest Tutorials
-
- Go language practical GraphQL
- 1942 2024-04-19
-
- 550W fan master learns JavaScript from scratch step by step
- 3361 2024-04-18
-
- Getting Started with MySQL (Teacher mosh)
- 1762 2024-04-07
-
- Mock.js | Axios.js | Json | Ajax--Ten days of quality class
- 2576 2024-03-29
<?php /** * A Compatibility library with PHP 5.5's simplified password hashing API. * * @author Anthony Ferrara <ircmaxell@php.net> * @license http://www.opensource.org/licenses/mit-license.html MIT License * @copyright 2012 The Authors */ namespace { if (!defined('PASSWORD_BCRYPT')) { /** * PHPUnit Process isolation caches constants, but not function declarations. * So we need to check if the constants are defined separately from * the functions to enable supporting process isolation in userland * code. */ define('PASSWORD_BCRYPT', 1); define('PASSWORD_DEFAULT', PASSWORD_BCRYPT); define('PASSWORD_BCRYPT_DEFAULT_COST', 10); }
I believe that when many PHP developers first came into contact with PHP, the preferred encryption function for handling passwords might be MD5. This is what I did at the time:
$password = md5($_POST["password "]);
Does the above code sound familiar? However, the MD5 encryption method seems to be not very popular in the PHP world at present, because its encryption algorithm is a bit simple, and many password cracking sites store a lot of MD5 encrypted password strings, so here I strongly discourage using MD5 alone to encrypt user passwords.
SHA256 and SHA512
In fact, there is a SHA1 encryption method at the same time as the previous MD5, but the algorithm is relatively simple, so I will briefly mention it here. The SHA256 and SHA512 we are about to talk about here are encryption functions from the SHA2 family. You may have guessed it by looking at the names. These two encryption methods generate hash strings of 256 and 512 bit length respectively.