PHP 클래스 Dcrypt\Mcrypt

Features: - PKCS #7 padding of messages - random IV selection - checksum validation with HMAC - tested to be compatible with many ciphers, modes and hashing algorithms. - highly customizable, but default options are most secure
상속: extends Cryptobase
파일 보기 프로젝트 열기: dopecode/dcrypt 1 사용 예제들

공개 메소드들

메소드 설명
decrypt ( string $cyphertext, string $password, integer $cost, string $cipher = MCRYPT_RIJNDAEL_128, string $mode = MCRYPT_MODE_CBC, string $algo = 'sha256' ) : string | boolean Decrypt cyphertext
encrypt ( string $plaintext, string $password, integer $cost, string $cipher = MCRYPT_RIJNDAEL_128, string $mode = MCRYPT_MODE_CBC, string $algo = 'sha256' ) : string Encrypt plaintext

메소드 상세

decrypt() 공개 정적인 메소드

Decrypt cyphertext
public static decrypt ( string $cyphertext, string $password, integer $cost, string $cipher = MCRYPT_RIJNDAEL_128, string $mode = MCRYPT_MODE_CBC, string $algo = 'sha256' ) : string | boolean
$cyphertext string Cypher text to decrypt
$password string Password that should be used to decrypt input data
$cost integer Number of HMAC iterations to perform on key
$cipher string Mcrypt cipher
$mode string Mcrypt mode
$algo string Hashing algorithm to use for internal operations
리턴 string | boolean Returns false on checksum validation failure

encrypt() 공개 정적인 메소드

Encrypt plaintext
public static encrypt ( string $plaintext, string $password, integer $cost, string $cipher = MCRYPT_RIJNDAEL_128, string $mode = MCRYPT_MODE_CBC, string $algo = 'sha256' ) : string
$plaintext string Plaintext string to encrypt
$password string Key used to encrypt data
$cost integer Number of HMAC iterations to perform on key
$cipher string Mcrypt cipher
$mode string Mcrypt mode
$algo string Hashing algorithm to use for internal operations
리턴 string