dentmate/rajahan

PHP package for encryption/decryption using AES algorithm compatible with CryptoJS

0.0.1 2022-09-28 09:12 UTC

This package is not auto-updated.

Last update: 2024-05-22 09:32:28 UTC


README

PHP package for encryption/decryption using AES algorithm compatible with CryptoJS.

Algorithm

Cipher AES-256
Mode CBC
Key Derivation evpkdf (OpenSSL custom, MD5, 1 iteration)

Installation

Installation is best done via Composer, you may use the following command:

composer require dentmate/rajahan

This will add the latest release of rajahan as a module to your project

Example

This is an example code for using this library:

<?php

use DentMate\Rajahan\AES;

$passphrase = 'my passphrase';
$plain = 'example value';

$encrypted = AES::encrypt($plain, $passphrase);
print_r('Encrypted : ' . $encrypted);

$decrypted = AES::decrypt($encrypted, $passphrase);
print_r('Decrypted : ' . $decrypted);

License

Code licensed under Apache 2.0 License.