Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
OO wrapper around mcrypt functions providing simple cryptography functionality
branch: master

* Moved string to encrypt from constructor to encrypt_data method

* Added unit test to check encryption and decryption methods
latest commit 27c0b22ee2
Glen Scott authored
Failed to load latest commit information.
README * Moved string to encrypt from constructor to encrypt_data method
SimpleCrypt.php * Moved string to encrypt from constructor to encrypt_data method
SimpleCryptTest.php * Moved string to encrypt from constructor to encrypt_data method
example.php

README

<?php

require_once 'SimpleCrypt.php';

// show the algorithms available for use
print_r( SimpleCrypt::get_available_algorithms() );

// encrypt a string using Triple DES (CBC mode)
$crypt = new SimpleCrypt( 'tripledes', 'mysecretkey' );
$encrypted_data = $crypt->encrypt_data( 'stringtoencrypt' );
echo "Encrypted data: " . bin2hex( $encrypted_data ) . "\n";
echo "Decrypted data: " . $crypt->decrypt_data( $encrypted_data ) . "\n";
Something went wrong with that request. Please try again.