\cge_encrypt

A simple class for doing secure encryption and decryption of data.

This class relies on the php mcrypt module.

Summary

Methods
Properties
Constants
encrypt()
decrypt()
No public properties found
No constants found
openssl_encrypt()
openssl_decrypt()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

encrypt()

encrypt(string  $key, string  $data) : string

Encrypt some data

Parameters

string $key

The encryption key. The longer and more unique this string is the more secure the encrypted data is. The key should also be kept in a secure location.

string $data

The data to encrypt.

Returns

string —

The encrypted data, or FALSE

decrypt()

decrypt(string  $key, string  $encdata) : string

Decrypt previously encrypted data

Parameters

string $key

The key used for encrypting the data.

string $encdata

The encrypted data"

Returns

string —

the decrypted data. or FALSE

openssl_encrypt()

openssl_encrypt(string  $key, string  $data) : string

Encrypt some data using openssl libraries

Parameters

string $key
string $data

Returns

string

openssl_decrypt()

openssl_decrypt(string  $key, string  $encdata) : string

Decrypt some data using openssl

Parameters

string $key
string $encdata

Returns

string