2017 © Pedro Peláez
 

library upcrypto

Streamline runtime upgrade of cryptography

image

lightster/upcrypto

Streamline runtime upgrade of cryptography

  • Saturday, July 7, 2018
  • by lightster
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11,791 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 9 % Grown

The README.md

upcrypto

Build Status Test Coverage Code Climate Dependency Status, (*1)

Streamline runtime upgrade of cryptography, (*2)

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

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);
}

The Versions

07/07 2018

dev-master

9999999-dev

Streamline runtime upgrade of cryptography

  Sources   Download

MIT

The Requires

  • php ^7

 

The Development Requires

07/07 2018

dev-require-php-7-upgrade-to-phpunit-6

dev-require-php-7-upgrade-to-phpunit-6

Streamline runtime upgrade of cryptography

  Sources   Download

MIT

The Requires

  • php ^7

 

The Development Requires

07/07 2018

dev-add-slack-ci-notifications

dev-add-slack-ci-notifications

Streamline runtime upgrade of cryptography

  Sources   Download

MIT

The Requires

  • php ^5.4.0 || ^7.0.0

 

The Development Requires

07/07 2018

dev-issue-18-create-docker-dev-environment

dev-issue-18-create-docker-dev-environment

Streamline runtime upgrade of cryptography

  Sources   Download

MIT

The Requires

  • php ^5.4.0 || ^7.0.0

 

The Development Requires

12/06 2017

v1.0.0

1.0.0.0

Streamline runtime upgrade of cryptography

  Sources   Download

MIT

The Requires

  • php ^5.4.0 || ^7.0.0

 

The Development Requires

22/09 2016

v0.1.4

0.1.4.0

Streamline runtime upgrade of cryptography

  Sources   Download

MIT

The Requires

 

The Development Requires

29/02 2016

v0.1.3

0.1.3.0

Streamline runtime upgrade of cryptography

  Sources   Download

The Requires

 

The Development Requires

31/07 2015

v0.1.2

0.1.2.0

Streamline runtime upgrade of cryptography

  Sources   Download

The Requires

 

The Development Requires

13/06 2015

v0.1.1

0.1.1.0

Streamline runtime upgrade of cryptography

  Sources   Download

The Requires

 

The Development Requires

13/06 2015

v0.1.0

0.1.0.0

Streamline runtime upgrade of cryptography

  Sources   Download

The Requires

 

The Development Requires

29/05 2015

v0.0.1

0.0.1.0

Streamline runtime upgrade of cryptography

  Sources   Download

The Requires

 

The Development Requires