The Encrypt filter allows to encrypt a file.
This filter makes use of Zend_Filter_Encrypt. It supports the
Mcrypt and OpenSSL extensions from
PHP. Please read the related section for details about how to set the
options for encryption and which options are supported.
This filter supports one additional option which can be used to save the encrypted file with another filename. Set the filename option to change the filename where the encrypted file will be stored. If you suppress this option, the encrypted file will overwrite the original file.
Example 420. Using the Encrypt filter with Mcrypt
<?php
$upload = new Zend_File_Transfer_Adapter_Http();
// Adds a filter to encrypt the uploaded file
// with mcrypt and the key mykey
$upload->addFilter('Encrypt',
array('adapter' => 'mcrypt', 'key' => 'mykey'));
Example 421. Using the Encrypt filter with OpenSSL
<?php
$upload = new Zend_File_Transfer_Adapter_Http();
// Adds a filter to encrypt the uploaded file
// with openssl and the provided keys
$upload->addFilter('Encrypt',
array('adapter' => 'openssl',
'public' => '/path/to/publickey.pem'));




