Jump to content

Downloading encrypted files


bigheadedd

Recommended Posts

Hi,

 

I'm wondering if anyone knows of any good information regarding downloading files.

I'm looking into creating a relatively simple download system, where people will be sent a link say (download.php?id=dnjwaAYFDAg734) (where id would be an encrypted value, and obviously a lot longer!). That script would then decode the id number and allow the user to download the appropriate file.

 

Any help would be hugely grateful as I'm a little unsure of where to go and a quick look through google doesn't show too much up.

 

Thanks

 

Edd

Link to comment
Share on other sites

I think you would want a hash. I would not really bother trying to do encryption. What would be a better method is have two tables in your SQL Database, one that references the files and one that has "allowed" the allowed table would store the hash and the link to the files table. When a user requests that hash it pulls it up and then you can have it delete after x minutes so then that hash is no longer valid to prevent hotlinking / people giving away the link. A simple random md5 or sha1 hash should suffice, just make sure to salt it up and randomize it with something like microtime.

 

 

Link to comment
Share on other sites

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.