All downloaded files are stored in a temporary PHP folder.
This temporary file path is accessible via the variable $ _FILES ["file"] ["tmp_name"] set by PHP after submitting the form.
You can then encode image data using an encoding algorithm (not encryption) such as base64_encode (), and then decode it for display using base64_decode ().
<?php $image_binary = fread(fopen($_FILES["file"]["tmp_name"], "r"), filesize($_FILES["file"]["tmp_name"])); $encoded_image = base64_encode($image_binary);
Another thing to keep in mind is that your PHP scripts are visible to anyone with admin access (like your host). Therefore, they will know which encryption method you used, and can learn about how to decrypt encrypted files.
Best encryption strategies: Best way to use PHP to encrypt and decrypt passwords?
source share