paragonie/halite-legacy

Legacy implementations of Halite (can be loaded alongside Halite to facilitate migrations)

v0.1.0 2019-03-18 15:01 UTC

This package is auto-updated.

Last update: 2024-11-19 10:51:32 UTC


README

See Halite for documentation, etc.

This library allows you to side-load an unsupported legacy version of Halite into your application in order to migrate data to the newest version.

Important

This library is out of scope for any bug bounty programs!

Please refer to Halite for a library that is in-scope.

Installing

Use Composer.

composer require paragonie/halite-legacy

Migrating Code

Simply use the legacy classes to facilitate decryption, and re-encrypt with the latest version of Halite.

<?php
use ParagonIE\Halite\Symmetric\{
    Crypto,
    EncryptionKey    
};
use ParagonIE\HaliteLegacy\V3\Symmetric\{
    Crypto as LegacyCrypto,
    EncryptionKey as LegacyKey
};
use ParagonIE\HaliteLegacy\V3\HiddenString as LegacyHiddenString;
use ParagonIE\HiddenString\HiddenString;

/**
 * @var EncryptionKey $encKey
 * @var LegacyKey $oldKey
 * @var string $ciphertext
 * @var LegacyHiddenString $plaintext
 */
$plaintext = LegacyCrypto::decrypt($ciphertext, $oldKey);
$storeMe = Crypto::encrypt(
    new HiddenString($plaintext->getString()),
    $encKey
);

Support Contracts

If your company uses this library in their products or services, you may be interested in purchasing a support contract from Paragon Initiative Enterprises.

Unpaid support will not be provided for halite-legacy.