Jelix 1.6.40

jCrypt
in package

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

Tags
subpackage

utils

deprecated

Table of Contents

decrypt()  : string
Decrypt a string with a specific key.
encrypt()  : string
Encrypt a string with a specific key
mcryptDecrypt()  : string
Decrypt a string with mCrypt.
mcryptEncrypt()  : string
Encrypt a string with mCrypt.
simpleCrypt()  : string
Basic encrypt/decrypt algorithm.
_getDefaultKey()  : string
Get default key in config

Methods

decrypt()

Decrypt a string with a specific key.

public static decrypt(string $string[, string $key = '' ]) : string

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

Parameters
$string : string

the string to decrypt

$key : string = ''

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

Return values
string

decrypted string

encrypt()

Encrypt a string with a specific key

public static encrypt(string $string[, string $key = '' ]) : string

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

Parameters
$string : string

the string to encrypt

$key : string = ''

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

Return values
string

encrypted string

mcryptDecrypt()

Decrypt a string with mCrypt.

public static mcryptDecrypt(string $string[, string $key = '' ]) : string
Parameters
$string : string

the string to decrypt

$key : string = ''

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

Tags
throws
jException
Return values
string

decrypted string

mcryptEncrypt()

Encrypt a string with mCrypt.

public static mcryptEncrypt(string $string[, string $key = '' ]) : string
Parameters
$string : string

the string to encrypt

$key : string = ''

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

Tags
throws
jException
Return values
string

encrypted string

simpleCrypt()

Basic encrypt/decrypt algorithm.

protected static simpleCrypt(string $str[, string $key = '' ]) : string
Parameters
$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

Tags
author

halojoy

see
http://www.phpbuilder.com/board/showthread.php?t=10326721
throws
jException
Return values
string

encrypted/decrypted string

_getDefaultKey()

Get default key in config

private static _getDefaultKey() : string
Tags
throws
jException
author

Hadrien Lanneau

Return values
string

Search results