PHP 클래스 Defuse\Crypto\Crypto

파일 보기 프로젝트 열기: defuse/php-encryption 1 사용 예제들

공개 메소드들

메소드 설명
decrypt ( string $ciphertext, Defuse\Crypto\Key $key, boolean $raw_binary = false ) : string Decrypts a ciphertext to a string with a Key.
decryptWithPassword ( string $ciphertext, string $password, boolean $raw_binary = false ) : string Decrypts a ciphertext to a string with a password, using a slow key derivation function to make password cracking more expensive.
encrypt ( string $plaintext, Defuse\Crypto\Key $key, boolean $raw_binary = false ) : string Encrypts a string with a Key.
encryptWithPassword ( string $plaintext, string $password, boolean $raw_binary = false ) : string Encrypts a string with a password, using a slow key derivation function to make password cracking more expensive.
legacyDecrypt ( string $ciphertext, string $key ) : string Decrypts a legacy ciphertext produced by version 1 of this library.

보호된 메소드들

메소드 설명
plainDecrypt ( string $ciphertext, string $key, string $iv, string $cipherMethod ) : string Raw unauthenticated decryption (insecure on its own).
plainEncrypt ( string $plaintext, string $key, string $iv ) : string Raw unauthenticated encryption (insecure on its own).
verifyHMAC ( string $correct_hmac, string $message, string $key ) : boolean Verifies an HMAC without leaking information through side-channels.

비공개 메소드들

메소드 설명
decryptInternal ( string $ciphertext, KeyOrPassword $secret, boolean $raw_binary ) : string Decrypts a ciphertext to a string with either a key or a password.
encryptInternal ( string $plaintext, KeyOrPassword $secret, boolean $raw_binary ) : string Encrypts a string with either a key or a password.

메소드 상세

decrypt() 공개 정적인 메소드

Decrypts a ciphertext to a string with a Key.
public static decrypt ( string $ciphertext, Defuse\Crypto\Key $key, boolean $raw_binary = false ) : string
$ciphertext string
$key Defuse\Crypto\Key
$raw_binary boolean
리턴 string

decryptWithPassword() 공개 정적인 메소드

Decrypts a ciphertext to a string with a password, using a slow key derivation function to make password cracking more expensive.
public static decryptWithPassword ( string $ciphertext, string $password, boolean $raw_binary = false ) : string
$ciphertext string
$password string
$raw_binary boolean
리턴 string

encrypt() 공개 정적인 메소드

Encrypts a string with a Key.
public static encrypt ( string $plaintext, Defuse\Crypto\Key $key, boolean $raw_binary = false ) : string
$plaintext string
$key Defuse\Crypto\Key
$raw_binary boolean
리턴 string

encryptWithPassword() 공개 정적인 메소드

Encrypts a string with a password, using a slow key derivation function to make password cracking more expensive.
public static encryptWithPassword ( string $plaintext, string $password, boolean $raw_binary = false ) : string
$plaintext string
$password string
$raw_binary boolean
리턴 string

legacyDecrypt() 공개 정적인 메소드

Decrypts a legacy ciphertext produced by version 1 of this library.
public static legacyDecrypt ( string $ciphertext, string $key ) : string
$ciphertext string
$key string
리턴 string

plainDecrypt() 보호된 정적인 메소드

Raw unauthenticated decryption (insecure on its own).
protected static plainDecrypt ( string $ciphertext, string $key, string $iv, string $cipherMethod ) : string
$ciphertext string
$key string
$iv string
$cipherMethod string
리턴 string

plainEncrypt() 보호된 정적인 메소드

Raw unauthenticated encryption (insecure on its own).
protected static plainEncrypt ( string $plaintext, string $key, string $iv ) : string
$plaintext string
$key string
$iv string
리턴 string

verifyHMAC() 보호된 정적인 메소드

Verifies an HMAC without leaking information through side-channels.
protected static verifyHMAC ( string $correct_hmac, string $message, string $key ) : boolean
$correct_hmac string
$message string
$key string
리턴 boolean