\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
No protected methods found
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