homepage Welcome to WebmasterWorld Guest from 54.227.141.230
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Help: encryption/decryption via PHP
keep sensitive files encrypted and decrypt for download.
transistor




msg:1245890
 12:01 am on Aug 2, 2002 (gmt 0)

Here's what I have:
Upload a file via HTTP to my server
Encrypt it
User request file, decrypt it.
Download file

I don't want to have to decrypt, then download.
Is there some way to encrypt the file so that it can be decrypted as downloaded?
Something like:

readfile (exec(some-decryption-command));

I really don't know, in fact, I'm not sure if I can explain correctly what I want! :)
Do I?
My server is OpenBSD 3.0 and PHP 4.0.6

 

DrDoc




msg:1245891
 7:23 am on Aug 5, 2002 (gmt 0)

As with any built-in encryption, there really is no way you can decrypt ..
So, the solution would have to be creating your own encryption algorithm .. which in this case is pointless anyway.

May I suggest two alternative solutions?

1) When the file is uploaded it will be placed in a directory that is not accessible through the browser .. meaning, the file would have to be downloaded using your PHP script.

2) When the file is uploaded its contents will be read and placed in a database (depending on file size). When the user requests the file its contents are fetched from the database.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved