9 Best PHP Password Libraries

share link

by Dhiren Gala dot icon Updated: Feb 28, 2023

technology logo
technology logo

Guide Kit Guide Kit  

Here are the best open-source PHP password libraries for your applications. You can use these to enable secure password storage and management functionality in PHP-based applications.


These libraries provide an essential layer of security to PHP applications by ensuring that user passwords are properly encrypted and protected from potential attackers. The PHP Password libraries offer a range of password hashing algorithms and functions to help developers protect the user's passwords against unauthorized access and data breaches. These Libraries support various hashing algorithms such as bcrypt, scrypt, Argon2, and PBKDF2 and provide a built-in mechanism for generating strong, random passwords. The PHP Password Hashing API provides a simple, secure, easy-to-use password hashing mechanism. Moreover, developers can customize the password hashing process according to their needs. Along with that, you get a variety of features for enforcing password policies, such as:

  • Password validation
  • Password generation
  • Maximum password age
  • Minimum password length
  • Password strength estimation 
  • Password complexity requirements


Overall, PHP password libraries help developers build more secure and reliable applications. Also, you can provide peace of mind to users who entrust their personal information to online services. We have handpicked the top and trending open-source PHP password libraries for your next application development project:

PHPass:

  • Uses the bcrypt algorithm for password hashing.
  • Provides strong password hashing and validation functionality.
  • It is compatible with PHP 5.6 and above.

phpassby rchouinard

PHP doticonstar image 240 doticonVersion:Currentdoticon
License: Permissive (MIT)

PHP Password Library: Easy, secure password management for PHP

Support
    Quality
      Security
        License
          Reuse

            phpassby rchouinard

            PHP doticon star image 240 doticonVersion:Currentdoticon License: Permissive (MIT)

            PHP Password Library: Easy, secure password management for PHP
            Support
              Quality
                Security
                  License
                    Reuse

                      Libsodium:

                      • Uses the Argon2 algorithm for password hashing.
                      • It is considered to be one of the strongest hashing algorithms available.
                      • Provides secure password hashing and is designed to be easy to use.

                      libsodium-phpby jedisct1

                      C doticonstar image 514 doticonVersion:Currentdoticon
                      License: Permissive (BSD-2-Clause)

                      The PHP extension for libsodium.

                      Support
                        Quality
                          Security
                            License
                              Reuse

                                libsodium-phpby jedisct1

                                C doticon star image 514 doticonVersion:Currentdoticon License: Permissive (BSD-2-Clause)

                                The PHP extension for libsodium.
                                Support
                                  Quality
                                    Security
                                      License
                                        Reuse

                                          Bcrypt:

                                          • Uses the bcrypt algorithm to provide a strong password hashing functionality.
                                          • It is known for its resistance to brute-force attacks.
                                          • Compatible with PHP 5.3 and above.

                                          php-bcryptby yftzeng

                                          PHP doticonstar image 11 doticonVersion:Currentdoticon
                                          no licences License: No License (null)

                                          bcrypt implementation for PHP

                                          Support
                                            Quality
                                              Security
                                                License
                                                  Reuse

                                                    php-bcryptby yftzeng

                                                    PHP doticon star image 11 doticonVersion:Currentdoticonno licences License: No License

                                                    bcrypt implementation for PHP
                                                    Support
                                                      Quality
                                                        Security
                                                          License
                                                            Reuse

                                                              PasswordLib:

                                                              • Used in Security, Cryptography applications, etc.
                                                              • It’s an all-inclusive cryptographic library that provides a wide range of password-related functionality.
                                                              • Features include password hashing, validation, and password strength assessment.

                                                              PHP-PasswordLibby ircmaxell

                                                              PHP doticonstar image 372 doticonVersion:Currentdoticon
                                                              no licences License: No License (null)

                                                              A library for generating and validating passwords

                                                              Support
                                                                Quality
                                                                  Security
                                                                    License
                                                                      Reuse

                                                                        PHP-PasswordLibby ircmaxell

                                                                        PHP doticon star image 372 doticonVersion:Currentdoticonno licences License: No License

                                                                        A library for generating and validating passwords
                                                                        Support
                                                                          Quality
                                                                            Security
                                                                              License
                                                                                Reuse

                                                                                  PHP Secure Communications Library:

                                                                                  • Uses the PBKDF2 algorithm for password hashing.
                                                                                  • Provides a range of security-related functions.
                                                                                  • Features include password hashing and validation.

                                                                                  phpseclibby phpseclib

                                                                                  PHP doticonstar image 5059 doticonVersion:3.0.20doticon
                                                                                  License: Permissive (MIT)

                                                                                  PHP Secure Communications Library

                                                                                  Support
                                                                                    Quality
                                                                                      Security
                                                                                        License
                                                                                          Reuse

                                                                                            phpseclibby phpseclib

                                                                                            PHP doticon star image 5059 doticonVersion:3.0.20doticon License: Permissive (MIT)

                                                                                            PHP Secure Communications Library
                                                                                            Support
                                                                                              Quality
                                                                                                Security
                                                                                                  License
                                                                                                    Reuse

                                                                                                      PasswordTools:

                                                                                                      • Uses the bcrypt algorithm for password hashing.
                                                                                                      • Provides a lightweight application to help you with password encryption.
                                                                                                      • It is compatible with PHP 5.3 and above.

                                                                                                      PasswordToolsby joeygallegos

                                                                                                      PHP doticonstar image 0 doticonVersion:Currentdoticon
                                                                                                      no licences License: No License (null)

                                                                                                      Lightweight application to help you with encrypting your passwords and making them more secure to use.

                                                                                                      Support
                                                                                                        Quality
                                                                                                          Security
                                                                                                            License
                                                                                                              Reuse

                                                                                                                PasswordToolsby joeygallegos

                                                                                                                PHP doticon star image 0 doticonVersion:Currentdoticonno licences License: No License

                                                                                                                Lightweight application to help you with encrypting your passwords and making them more secure to use.
                                                                                                                Support
                                                                                                                  Quality
                                                                                                                    Security
                                                                                                                      License
                                                                                                                        Reuse

                                                                                                                          PasswordHash:

                                                                                                                          • Used in Security, Hashing, Symfony applications, etc.
                                                                                                                          • Provides strong password hashing and validation functionality.
                                                                                                                          • Uses the bcrypt algorithm and is compatible with PHP 5.3 and above.

                                                                                                                          password-hasherby symfony

                                                                                                                          PHP doticonstar image 569 doticonVersion:v6.3.0-BETA1doticon
                                                                                                                          License: Permissive (MIT)

                                                                                                                          Provides password hashing utilities

                                                                                                                          Support
                                                                                                                            Quality
                                                                                                                              Security
                                                                                                                                License
                                                                                                                                  Reuse

                                                                                                                                    password-hasherby symfony

                                                                                                                                    PHP doticon star image 569 doticonVersion:v6.3.0-BETA1doticon License: Permissive (MIT)

                                                                                                                                    Provides password hashing utilities
                                                                                                                                    Support
                                                                                                                                      Quality
                                                                                                                                        Security
                                                                                                                                          License
                                                                                                                                            Reuse

                                                                                                                                              Sodium Compat:

                                                                                                                                              • Used to implement the Libsodium functionality on systems that do not support it natively.
                                                                                                                                              • Provides a compatibility layer for the Libsodium library.
                                                                                                                                              • Supports PHP 5.2.4 - 8.x

                                                                                                                                              sodium_compatby paragonie

                                                                                                                                              PHP doticonstar image 793 doticonVersion:v1.17.1doticon
                                                                                                                                              License: Permissive (ISC)

                                                                                                                                              Pure PHP polyfill for ext/sodium

                                                                                                                                              Support
                                                                                                                                                Quality
                                                                                                                                                  Security
                                                                                                                                                    License
                                                                                                                                                      Reuse

                                                                                                                                                        sodium_compatby paragonie

                                                                                                                                                        PHP doticon star image 793 doticonVersion:v1.17.1doticon License: Permissive (ISC)

                                                                                                                                                        Pure PHP polyfill for ext/sodium
                                                                                                                                                        Support
                                                                                                                                                          Quality
                                                                                                                                                            Security
                                                                                                                                                              License
                                                                                                                                                                Reuse

                                                                                                                                                                  Password-generator:

                                                                                                                                                                  • Used in Generators, Generator Utils applications, etc.
                                                                                                                                                                  • It’s a simple library for generating random passwords.
                                                                                                                                                                  • Support PHP 7.3+.

                                                                                                                                                                  password-generatorby hackzilla

                                                                                                                                                                  PHP doticonstar image 257 doticonVersion:Currentdoticon
                                                                                                                                                                  License: Permissive (MIT)

                                                                                                                                                                  PHP Library to generate random passwords

                                                                                                                                                                  Support
                                                                                                                                                                    Quality
                                                                                                                                                                      Security
                                                                                                                                                                        License
                                                                                                                                                                          Reuse

                                                                                                                                                                            password-generatorby hackzilla

                                                                                                                                                                            PHP doticon star image 257 doticonVersion:Currentdoticon License: Permissive (MIT)

                                                                                                                                                                            PHP Library to generate random passwords
                                                                                                                                                                            Support
                                                                                                                                                                              Quality
                                                                                                                                                                                Security
                                                                                                                                                                                  License
                                                                                                                                                                                    Reuse

                                                                                                                                                                                      See similar Kits and Libraries