Hi, I am banging my head against the wall for last 5 days. I CANT find any way to encrypt uploaded files (any extension txt,pdf,mp3,exe...etc). I am working on a data management system and it needs to have encryption so the files people are storing with it can be accessed only from the app. app was created in Flex and it uses PHP to handle file upload. the biggest problem is that i have no idea on which server it will be hosted so the encryption i implement needs to be multi-platform(so no shell_exec unfortunately). i have tryed anything i could think of, i even tryed to pull data from the file, encrypt it and then write it back into the file but that doesnt work properly with anything that is not txt. so that rules out mcrypt, crypt... does anyone have any experience with this kind of problem if nothing else point me to the right direction. TNX.
Can you store the files in a database? Most databases have encryption functions. Mysql can use AES and DES.
well maybe if you want to encrypt the contents use fopen(),fwrite(),fclose() functions then base64_encode might be of good help ^^,
yup change the file name when you uploading it use $_FILES['user_file']['name'] = $your_new_filename";
If crypt() only works with non txt files but scrambles up the data for text, the error most likely is in your code and is not really related to encryption. After encrypting ASCII files make sure to save in binary format?
tnx for all replys files have changed names so one needs browse the database and compare with files so he would know what i what. but that is not sufficient, i cant store them in the database cause some of the files will be more than 10 mb in size i think it would kill a DB after a while imagine having 1GB of data in your DB i'll try with fopen,fwrite ... again maybe i did some thing wrong the first time. if anyone thinks of something please post it here.