PHP 클래스 FOF30\Encrypt\Aes

파일 보기 프로젝트 열기: akeeba/fof 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $key, integer $strength = 256, string $mode = 'cbc' ) Initialise the AES encryption object
decryptString ( string $stringToDecrypt, boolean $base64encoded = true ) : string Decrypts a ciphertext into a plaintext string using AES
encryptString ( string $stringToEncrypt, boolean $base64encoded = true ) : string Encrypts a string using AES
isSupported ( Phpfunc $phpfunc = null ) : boolean Is AES encryption supported by this PHP installation?

메소드 상세

__construct() 공개 메소드

Initialise the AES encryption object
public __construct ( string $key, integer $strength = 256, string $mode = 'cbc' )
$key string The encryption key (password). It can be a raw key (32 bytes) or a passphrase.
$strength integer Bit strength (128, 192 or 256)
$mode string Ecnryption mode. Can be ebc or cbc. We recommend using cbc.

decryptString() 공개 메소드

Decrypts a ciphertext into a plaintext string using AES
public decryptString ( string $stringToDecrypt, boolean $base64encoded = true ) : string
$stringToDecrypt string The ciphertext to decrypt. The first 16 bytes of the raw string must contain the IV (initialisation vector).
$base64encoded boolean Should I Base64-decode the data before decryption?
리턴 string The plain text string

encryptString() 공개 메소드

Encrypts a string using AES
public encryptString ( string $stringToEncrypt, boolean $base64encoded = true ) : string
$stringToEncrypt string The plaintext to encrypt
$base64encoded boolean Should I Base64-encode the result?
리턴 string The cryptotext. Please note that the first 16 bytes of the raw string is the IV (initialisation vector) which is necessary for decoding the string.

isSupported() 공개 정적인 메소드

Is AES encryption supported by this PHP installation?
public static isSupported ( Phpfunc $phpfunc = null ) : boolean
$phpfunc FOF30\Utils\Phpfunc
리턴 boolean