if ($crypt == true && extension_loaded('sodium') == true) {
$crypt_key = jirafeau_encrypt_file($file['tmp_name'], $file['tmp_name'].'crypt');
if (strlen($crypt_key) > 0) {
if ($crypt == true && extension_loaded('sodium') == true) {
$crypt_key = jirafeau_encrypt_file($file['tmp_name'], $file['tmp_name'].'crypt');
if (strlen($crypt_key) > 0) {
$crypt_key = jirafeau_encrypt_file($p, $p.'.crypt');
if (strlen($crypt_key) > 0) {
$crypt_key = jirafeau_encrypt_file($p, $p.'.crypt');
if (strlen($crypt_key) > 0) {
* @return decrypt key composed of the key and the iv separated by a point ('.')
*/
function jirafeau_encrypt_file($fp_src, $fp_dst)
{
$fs = filesize($fp_src);
* @return decrypt key composed of the key and the iv separated by a point ('.')
*/
function jirafeau_encrypt_file($fp_src, $fp_dst)
{
$fs = filesize($fp_src);
* @param $k string composed of the key and the iv separated by a point ('.')
* @return key used to decrypt. a string of length 0 is returned if failed.
*/
function jirafeau_decrypt_file($fp_src, $fp_dst, $k)
{
$fs = filesize($fp_src);
* @param $k string composed of the key and the iv separated by a point ('.')
* @return key used to decrypt. a string of length 0 is returned if failed.
*/
function jirafeau_decrypt_file($fp_src, $fp_dst, $k)
{
$fs = filesize($fp_src);
* @param $fp_src file path to the file to decrypt.
* @param $fp_dst file path to the file to write decrypted file (could be the same).
* @param $k string composed of the key and the iv separated by a point ('.')
* @param $fp_src file path to the file to decrypt.
* @param $fp_dst file path to the file to write decrypted file (could be the same).
* @param $k string composed of the key and the iv separated by a point ('.')