Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/75239-encrypting-a-file-for-upload/
Share on other sites

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.