PHP | Imagick encipherImage() Function
Last Updated :
23 Jul, 2019
The Imagick::encipherImage() function is an inbuilt function in PHP which is used to convert plain pixels image into enciphered pixels. This function simply converts the pixels to enciphered pixels and then the image can be readable only if decipher the image with the same string with which it was enciphered.
Syntax:
bool Imagick::encipherImage( $passphrase )
Parameters: This function accepts single parameter $passphrase which holds the passphrase value.
Return Value: It returns True on success or False on failure.
Below program illustrates the Imagick::encipherImage() function in PHP:
Program:
<?php
$image = new Imagick(
$passphrase = "GeeksforGeeks" ;
$image ->encipherImage( $passphrase );
header( "Content-Type: image/jpg" );
echo $image ;
?>
|
Output:
Deciphered image if the passphrase is incorrect :
Reference: https://php.net/manual/en/imagick.encipherimage.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...