severndigital Posted October 29, 2007 Share Posted October 29, 2007 Anyone know if this is possible? basically I want to allow for a file upload but encrypt the data much like SCP but through the PHP script? I've look through some of the php.net functions but it only seems to cover encrypting text like through an md5() command and things like that. Thanks, Chris Quote Link to comment https://forums.phpfreaks.com/topic/75239-encrypting-a-file-for-upload/ Share on other sites More sharing options...
recklessgeneral Posted October 29, 2007 Share Posted October 29, 2007 Hi Chris, You can't achieve this strictly through PHP as PHP only deals with server-side processing and uploading a file is instigated by the client. To get scp-like encryption, the browser would have to encrypt the file before posting the data to the server - this would require Javascript or some other client side processing, but I'm not that familiar with javascript. You would also need a way to synchronize the keys between client and server. Alternatively, you could set up a secure server, then all communication would be encrypted. Note: md5 is not an encryption function but a digital message digest function. The difference is that encryption can be reversed if you know the key, whereas md5 is only a oneway function useful for authentication. Check out mcrypt function for php encryption. Cheers, Darren. Quote Link to comment https://forums.phpfreaks.com/topic/75239-encrypting-a-file-for-upload/#findComment-380571 Share on other sites More sharing options...
severndigital Posted October 29, 2007 Author Share Posted October 29, 2007 I assumed as much, but I was hoping. I will poke around, maybe there is a premade ajax script that will handle this. thanks, chris Quote Link to comment https://forums.phpfreaks.com/topic/75239-encrypting-a-file-for-upload/#findComment-380575 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.