jCrypt

Static methods help to encrypt and decrypt string. mCrypt is used if it is installed, else a basic algorithm is used.

package

jelix

subpackage

utils

deprecated

Methods

Get default key in config

_getDefaultKey() : string
static
author

Hadrien Lanneau

Throws
\jException

Response

string

Decrypt a string with a specific key.

decrypt(string $string, string $key = '') : string
static

Use mCrypt if it is installed, else a basic algorithm.

Arguments

$string

string

the string to decrypt

$key

string

the key used to decrypt. If not given, use the key indicated in the configuration

Response

string

decrypted string

Encrypt a string with a specific key

encrypt(string $string, string $key = '') : string
static

Use mCrypt if it is installed, else a basic algorithm.

Arguments

$string

string

the string to encrypt

$key

string

the key used to encrypt. If not given, use the key indicated in the configuration

Response

string

encrypted string

Decrypt a string with mCrypt.

mcryptDecrypt(string $string, string $key = '') : string
static
Throws
\jException

Arguments

$string

string

the string to decrypt

$key

string

the key used to decrypt string. If not given, use the key indicated in the configuration

Response

string

decrypted string

Encrypt a string with mCrypt.

mcryptEncrypt(string $string, string $key = '') : string
static
Throws
\jException

Arguments

$string

string

the string to encrypt

$key

string

the key used to encrypt string. If not given, use the key indicated in the configuration

Response

string

encrypted string

Basic encrypt/decrypt algorithm.

simpleCrypt(string $str, string $key = '') : string
static
author

halojoy

see http://www.phpbuilder.com/board/showthread.php?t=10326721
Throws
\jException

Arguments

$str

string

the string to encrypt/decrypt

$key

string

the key used to encrypt/decrypt string (must be >= 8 characters). If not given, use the key indicated in the configuration

Response

string

encrypted/decrypted string