PHPackages                             eddieantonio/bcrypt - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. eddieantonio/bcrypt

ActiveLibrary

eddieantonio/bcrypt
===================

Bcrypt class stolen from the internet, for use with Composer.

0.3.3(13y ago)152.9kCC0-1.0PHP

Since Feb 23Pushed 12y ago1 watchersCompare

[ Source](https://github.com/eddieantonio/bcrypt)[ Packagist](https://packagist.org/packages/eddieantonio/bcrypt)[ RSS](/packages/eddieantonio-bcrypt/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

`Bcrypt.php`
============

[](#bcryptphp)

**Forked (from myself) at [BitBucket](https://bitbucket.org/eddieantonio/bcrypt.php).**

This is my personal Bcrypt wrapper class-thing I use in my projects for Bcrypting buisness. It was mostly not written by me -- check the file comment in the file for all the peeps I attribute this file to. That said, a quick check on the internet shows a bajillion and one files *exactly* like this one, all with different names. THE PEOPLE'S BCRYPT MINILIBRARY... THING.

It is based on [Andrew Moore's answer](http://stackoverflow.com/a/6337021) on StackOverflow. If you're using PHP 5.5 or greater, use [`password_hash`](http://php.net/password_hash) instead.

**Use at your own risk. I offer absolutely no warranty on the cryptographic amazingness of this library, nor do any of the original authors... probably.**

Usage
=====

[](#usage)

Use the convenience functions to do some simple hashing and verifying of hashes.

```
$hashed = \Bcrypt\hash('this is a random string');

// elsewhere...

$plain_text_password = //...

if (\Bcrypt\verify($plain_text_password, $user_pass_hash)) {
  login();
}
```

For more fine-grained control, instantiate a `Bcrypt` object:

```
// Control the prefix, number of rounds...
$bcrypt = new \Bcrypt\Bcrypt('prefix', 15);

// And use the instance to produce many hashes.
$hashes[] = $bcrypt->hash('this is a string');
$hashes[] = $bcrypt->hash('this is another string');

// You can also do this:

if ($bcrypt->verify($plain_text_password, $user_pass_hash)) {
  login();
}
```

Composer
--------

[](#composer)

If you're using Composer, you can just add this to your require list:

```
{
    "require": {
        "eddieantonio/bcrypt": "0.3.0"
    }
}
```

License
=======

[](#license)

[Creative Commons Public Domain Declaration](http://creativecommons.org/publicdomain/zero/1.0/)

Since the meat of this code was stolen from various sources who simply posted the code on the internet with no license, I consider this library to be public domain by default and take no credit in writing it; simply polishing it up such that it can be easily used with Composer.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

5

Last Release

4830d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ab179200370c56f2ac34e2b4ea45be504dd1f55005c57681ba09a42eeecf61f?d=identicon)[eddieantonio](/maintainers/eddieantonio)

---

Top Contributors

[![eddieantonio](https://avatars.githubusercontent.com/u/2294397?v=4)](https://github.com/eddieantonio "eddieantonio (9 commits)")[![vierbergenlars](https://avatars.githubusercontent.com/u/1194648?v=4)](https://github.com/vierbergenlars "vierbergenlars (1 commits)")

### Embed Badge

![Health badge](/badges/eddieantonio-bcrypt/health.svg)

```
[![Health](https://phpackages.com/badges/eddieantonio-bcrypt/health.svg)](https://phpackages.com/packages/eddieantonio-bcrypt)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
