PHPackages                             browomir/open-encryption - 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. [Security](/categories/security)
4. /
5. browomir/open-encryption

ActiveLibrary[Security](/categories/security)

browomir/open-encryption
========================

Simple users password encryption class based on OpenSSL

063PHP

Since Nov 13Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Open Encryption
===============

[](#open-encryption)

Simple password encryption class based on [OpenSSL](http://php.net/manual/en/book.openssl.php).

Prerequisites
=============

[](#prerequisites)

- PHP 5.4 or later

Installation
============

[](#installation)

The preferred way to install this class is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require browomir/open-encryption "dev-master"
```

or add

```
// composer.json
{
    "require": {
        "browomir/open-encryption": "dev-master"
    }
}
```

to the require section of your `composer.json` file.

Usage
=====

[](#usage)

This simple example show how you can use this class:

```
require_once 'vendor/autoload.php';

use OpenEncryption\Encryption;

$username = 'test@example.com';
$password = 'test123';
$salt = 'somesalt';

$encryption = new Encryption(); // you can pass secret key as constructor parameter
                                // e.g. $encryption = new Encryption('mySecret');
$encrypted = $encryption->encrypt($password, $salt, $username);
$decrypted = $encryption->decrypt($encrypted, $salt, $username);

echo 'Encrypted: ' . $encrypted;
echo '';
echo 'Decrypted: ' . $decrypted;
```

Additional:

- if you don't want use default cipher method (AES-256-CBC) you can set your own:

```
$cipher = new Cipher('AES-128-ECB');
$encryption->setCipher($cipher);
```

- you can check if chosen cipher is supported and/or is strong:

```
if ($cipher->isSupported() && $cipher->isCryptoStrong()) {
    echo 'Your cipher is good!';
} else {
    echo 'You should chose other cipher!';
}
```

- you can get list of all supported cipher by:

```
$cipher->getSupportedCiphers();
```

[![Build Status](https://camo.githubusercontent.com/92a156ecfcdb8dfafed41f6b1b0a1fb836c6943ded58820c908d1728f68cd4b0/68747470733a2f2f7472617669732d63692e6f72672f42726f776f6d69722f6f70656e2d656e6372797074696f6e2e737667)](https://travis-ci.org/Browomir/open-encryption)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ba15c8abb28c7068ef29f1453f9f516368c07f0a9f15788a1af804b8b28c5881/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f42726f776f6d69722f6f70656e2d656e6372797074696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Browomir/open-encryption/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/1f687ba3f22fb96631eeebdc3888b2a7ccc8b1bb2a7a05878887778d4687c660/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f42726f776f6d69722f6f70656e2d656e6372797074696f6e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Browomir/open-encryption/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/fa6eb682cdbd16ce1710ba8599b5916c544b1c8f24d8bbe7e0155cfd4f27879f/68747470733a2f2f706f7365722e707567782e6f72672f62726f776f6d69722f6f70656e2d656e6372797074696f6e2f762f737461626c65)](https://packagist.org/packages/browomir/open-encryption)[![Latest Unstable Version](https://camo.githubusercontent.com/357f2137f614ccd90a2d946ee5b1f23fa2e053ecd18ed6107661116253b043b7/68747470733a2f2f706f7365722e707567782e6f72672f62726f776f6d69722f6f70656e2d656e6372797074696f6e2f762f756e737461626c65)](https://packagist.org/packages/browomir/open-encryption)[![Dependency Status](https://camo.githubusercontent.com/a5e4fbe6461d35311050f25c48c2d407c0a89ee454fcb918ec62c9f761f84775/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3536336531373766346434313565303031623030303062662f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/563e177f4d415e001b0000bf)[![Total Downloads](https://camo.githubusercontent.com/2828f18302b94b4c0b0caf74139bd3178a309e608eec12f345b0fd7a2f37709c/68747470733a2f2f706f7365722e707567782e6f72672f62726f776f6d69722f6f70656e2d656e6372797074696f6e2f646f776e6c6f616473)](https://packagist.org/packages/browomir/open-encryption)[![License](https://camo.githubusercontent.com/95e843806092389faeef8aeace89414b3ad97f3afdc0f2a248cd453d0179dc51/68747470733a2f2f706f7365722e707567782e6f72672f62726f776f6d69722f6f70656e2d656e6372797074696f6e2f6c6963656e7365)](https://packagist.org/packages/browomir/open-encryption)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f8ec02f8f8b932d9505294fdb0814c60ba185a3bfac6c62d4be5f03297c96de?d=identicon)[Browomir](/maintainers/Browomir)

---

Top Contributors

[![Browomir](https://avatars.githubusercontent.com/u/10349149?v=4)](https://github.com/Browomir "Browomir (48 commits)")

### Embed Badge

![Health badge](/badges/browomir-open-encryption/health.svg)

```
[![Health](https://phpackages.com/badges/browomir-open-encryption/health.svg)](https://phpackages.com/packages/browomir-open-encryption)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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