websoftwares / cipher
Encrypts/decrypts text with RIJNDAEL 256 Cipher
dev-master
2013-03-31 09:51 UTC
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2024-12-15 03:50:47 UTC
README
Encrypts/decrypts text with RIJNDAEL 256 Cipher.
Usage
$securekey = '4s05Gim69k6Cn7E4Wl03cEI5v9K49l95';
$size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CFB);
$iv = mcrypt_create_iv($size, MCRYPT_DEV_URANDOM);
$cipher = new Cipher($securekey, $iv);
$encrypted = $cipher->encrypt('MySuperSecretText');
$decrypted = $cipher->decrypt($encrypted);
echo $decrypted;