PHPackages                             lightster/upcrypto - 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. lightster/upcrypto

ActiveLibrary[Security](/categories/security)

lightster/upcrypto
==================

Streamline runtime upgrade of cryptography

v1.0.0(8y ago)136.6k↓13.6%MITPHPPHP ^5.4.0 || ^7.0.0

Since May 29Pushed 7y ago1 watchersCompare

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

READMEChangelog (7)Dependencies (4)Versions (8)Used By (0)

upcrypto
========

[](#upcrypto)

[![Build Status](https://camo.githubusercontent.com/9640d4f3d549434a596041a02d9d2897451009ca3d383d2b04d3dd46c547d040/68747470733a2f2f7472617669732d63692e6f72672f6c69676874737465722f757063727970746f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/lightster/upcrypto)[![Test Coverage](https://camo.githubusercontent.com/a5f4e1c609a59e4f24fa8d8a84833c86556959793afd324035cabc2b0652afdb/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6c69676874737465722f757063727970746f2f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/lightster/upcrypto/coverage)[![Code Climate](https://camo.githubusercontent.com/5fec641d183fac91a0e4fa30604b965eac6df27889e60c16e22b94ccb7b52559/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6c69676874737465722f757063727970746f2f6261646765732f6770612e737667)](https://codeclimate.com/github/lightster/upcrypto)[![Dependency Status](https://camo.githubusercontent.com/efc699fd82d1563813a9f3f68337218156f02843e4b9896cbd8840517e6297f6/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3535626563343835363533373632303032303030323062632f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/55bec48565376200200020bc)

Streamline runtime upgrade of cryptography

Upcrypto allows for changing of encryption keys or encryption methods without affecting historical data and with the ability to upgrade encrypted data over time.

Example
-------

[](#example)

```
$versions = [
    '2017.01.31' => [
        'crypto_adapter' => '\Lstr\Upcrypto\CryptoAdapter\DefuseAdapter',
        'crypto_key' => 'def000007abb9fab43861eb5a2579460cfcbec7774ecb84bf7ddd3379ebdcf52b6c2'
            . '2955049147eac6aa93ebfa6d2452650b222b1def408fe9c58ea527544a41602fe44f',
    ],
    '2017.05.19' => [
        'crypto_adapter' => '\Lstr\Upcrypto\CryptoAdapter\DefuseAdapter',
        'crypto_key' => 'def00000d988a0280b5580151c2f207934b6abcd5e59e2cab81c11214f6e2e84c1a8'
            . '1627fb3e9634ae1c36d3958ca2491fb95a1337a897338030e77662b38a7cf7fc9dcd',
    ],
];

$original_version_loader = new ArrayCryptoVersionLoader([
    '2017.01.31' => $versions['2017.01.31']
]);
$original_upcrypto = new Upcrypto($original_version_loader);
$loaded_value = $original_upcrypto->encrypt('tada');
// pretend the encrypted $loaded_value is actually stored in a database
// and we just read the encrypted value from the database into $loaded_value

$version_loader = new ArrayCryptoVersionLoader([
    '2017.01.31' => $versions['2017.01.31'],
    '2017.05.19' => $versions['2017.05.19'],
]);
$upcrypto = new Upcrypto($version_loader);

// if you just want to decrypt the value
$original_decrypted = $upcrypto->decrypt($loaded_value);

// if we want to check if the encryption is our most current
// method of encryption
if (!$upcrypto->isUpToDate($loaded_value)) {
    // if it is not, we can upgrade it to the latest methodology
    $upgraded_encrypted_value = $upcrypto->upgradeEncryption($loaded_value);
    // now you can save the data back to the database

    // the upgraded version still decrypts to the propery value
    $newly_decrypted = $upcrypto->decrypt($upgraded_encrypted_value);
}
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~124 days

Recently: every ~182 days

Total

7

Last Release

3262d ago

Major Versions

v0.1.4 → v1.0.02017-06-12

PHP version history (2 changes)v0.0.1PHP ~5.4

v0.1.3PHP ^5.4.0 || ^7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/622d21e6a5fe8af408cb5875fc26cdd8ea10267b24699fc0157b282b583bea33?d=identicon)[lightster](/maintainers/lightster)

---

Top Contributors

[![lightster](https://avatars.githubusercontent.com/u/1365612?v=4)](https://github.com/lightster "lightster (44 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lightster-upcrypto/health.svg)

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

###  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)
