error_log("PHP extension sodium not loaded, won't encrypt in Jirafeau");
}
if ($crypt_module_enabled == true && extension_loaded('sodium') == true) {
- $crypt_key = jirafeau_encrypt_file($file_path, $file_path.'crypt');
+ $crypt_key = jirafeau_encrypt_file($file_path, $file_path.'.crypt');
if (strlen($crypt_key) > 0) {
- if (rename($file_path.'crypt', $file_path) === true) {
+ if (rename($file_path.'.crypt', $file_path) === true) {
$crypted = true;
}
}
/* hash password or empty. */
$password = '';
if (!empty($key)) {
- $password = hash('sha256', $key);
+ $password = '[SHA256]' . hash('sha256', $key);
}
/* create link file */
$handle,
$name . NL. $mime_type . NL. $size . NL. $password . NL. $time .
NL . $hash. NL . ($one_time_download ? 'O' : 'R') . NL . time() .
- NL . $ip . NL. $delete_link_code . NL . ($crypted ? 'C' : 'O')
+ NL . $ip . NL. $delete_link_code . NL . ($crypted ? 'C2' : 'O')
);
fclose($handle);
$hash_link = substr(base_16_to_64(md5_file($link_tmp_name)), 0, $link_name_length);
$out .= "- version: " . JIRAFEAU_VERSION . "<br/>";
$jirafeau_options = [
'debug',
+ 'debug_enforce_classic_upload',
'file_hash',
'litespeed_workaround',
'store_uploader_ip',
/* sha256 password or empty */
$password = '';
if (!empty($key)) {
- $password = hash('sha256', $key);
+ $password = '[SHA256]' . hash('sha256', $key);
}
/* Store information. */