PHP 클래스 Defuse\Crypto\File

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

공개 메소드들

메소드 설명
decryptFile ( string $inputFilename, string $outputFilename, Defuse\Crypto\Key $key ) Decrypts the input file, saving the plaintext to the output file.
decryptFileWithPassword ( string $inputFilename, string $outputFilename, string $password ) Decrypts a file with a password, using a slow key derivation function to make password cracking more expensive.
decryptResource ( resource $inputHandle, resource $outputHandle, Defuse\Crypto\Key $key ) Takes two resource handles and decrypts the contents of the first, writing the plaintext into the second.
decryptResourceInternal ( resource $inputHandle, resource $outputHandle, KeyOrPassword $secret ) Decrypts a file-backed resource with either a key or a password.
decryptResourceWithPassword ( resource $inputHandle, resource $outputHandle, string $password ) Decrypts the contents of one resource into another with a password, using a slow key derivation function to make password cracking more expensive.
encryptFile ( string $inputFilename, string $outputFilename, Defuse\Crypto\Key $key ) Encrypts the input file, saving the ciphertext to the output file.
encryptFileWithPassword ( string $inputFilename, string $outputFilename, string $password ) Encrypts a file with a password, using a slow key derivation function to make password cracking more expensive.
encryptResource ( resource $inputHandle, resource $outputHandle, Defuse\Crypto\Key $key ) Takes two resource handles and encrypts the contents of the first, writing the ciphertext into the second.
encryptResourceWithPassword ( resource $inputHandle, resource $outputHandle, string $password ) Encrypts the contents of one resource handle into another with a password, using a slow key derivation function to make password cracking more expensive.
readBytes ( resource $stream, integer $num_bytes ) : string Read from a stream; prevent partial reads.
writeBytes ( resource $stream, string $buf, integer $num_bytes = null ) : string Write to a stream; prevents partial writes.

비공개 메소드들

메소드 설명
decryptFileInternal ( string $inputFilename, string $outputFilename, KeyOrPassword $secret ) Decrypts a file with either a key or a password.
encryptFileInternal ( string $inputFilename, string $outputFilename, KeyOrPassword $secret ) Encrypts a file with either a key or a password.
encryptResourceInternal ( resource $inputHandle, resource $outputHandle, KeyOrPassword $secret ) Encrypts a resource with either a key or a password.
getLastErrorMessage ( ) : string Returns the last PHP error's or warning's message string.

메소드 상세

decryptFile() 공개 정적인 메소드

Decrypts the input file, saving the plaintext to the output file.
public static decryptFile ( string $inputFilename, string $outputFilename, Defuse\Crypto\Key $key )
$inputFilename string
$outputFilename string
$key Defuse\Crypto\Key

decryptFileWithPassword() 공개 정적인 메소드

Decrypts a file with a password, using a slow key derivation function to make password cracking more expensive.
public static decryptFileWithPassword ( string $inputFilename, string $outputFilename, string $password )
$inputFilename string
$outputFilename string
$password string

decryptResource() 공개 정적인 메소드

Takes two resource handles and decrypts the contents of the first, writing the plaintext into the second.
public static decryptResource ( resource $inputHandle, resource $outputHandle, Defuse\Crypto\Key $key )
$inputHandle resource
$outputHandle resource
$key Defuse\Crypto\Key

decryptResourceInternal() 공개 정적인 메소드

Decrypts a file-backed resource with either a key or a password.
public static decryptResourceInternal ( resource $inputHandle, resource $outputHandle, KeyOrPassword $secret )
$inputHandle resource
$outputHandle resource
$secret KeyOrPassword

decryptResourceWithPassword() 공개 정적인 메소드

Decrypts the contents of one resource into another with a password, using a slow key derivation function to make password cracking more expensive.
public static decryptResourceWithPassword ( resource $inputHandle, resource $outputHandle, string $password )
$inputHandle resource
$outputHandle resource
$password string

encryptFile() 공개 정적인 메소드

Encrypts the input file, saving the ciphertext to the output file.
public static encryptFile ( string $inputFilename, string $outputFilename, Defuse\Crypto\Key $key )
$inputFilename string
$outputFilename string
$key Defuse\Crypto\Key

encryptFileWithPassword() 공개 정적인 메소드

Encrypts a file with a password, using a slow key derivation function to make password cracking more expensive.
public static encryptFileWithPassword ( string $inputFilename, string $outputFilename, string $password )
$inputFilename string
$outputFilename string
$password string

encryptResource() 공개 정적인 메소드

Takes two resource handles and encrypts the contents of the first, writing the ciphertext into the second.
public static encryptResource ( resource $inputHandle, resource $outputHandle, Defuse\Crypto\Key $key )
$inputHandle resource
$outputHandle resource
$key Defuse\Crypto\Key

encryptResourceWithPassword() 공개 정적인 메소드

Encrypts the contents of one resource handle into another with a password, using a slow key derivation function to make password cracking more expensive.
public static encryptResourceWithPassword ( resource $inputHandle, resource $outputHandle, string $password )
$inputHandle resource
$outputHandle resource
$password string

readBytes() 공개 정적인 메소드

Read from a stream; prevent partial reads.
public static readBytes ( resource $stream, integer $num_bytes ) : string
$stream resource
$num_bytes integer
리턴 string

writeBytes() 공개 정적인 메소드

Write to a stream; prevents partial writes.
public static writeBytes ( resource $stream, string $buf, integer $num_bytes = null ) : string
$stream resource
$buf string
$num_bytes integer
리턴 string