using joomla (or even just PHP), how would you obfuscate a PDF filename? -



using joomla (or even just PHP), how would you obfuscate a PDF filename? -

i have file, phone call secret.pdf, offer download. however, maintain having url can copied / pasted or typed out www.website.com/pdf/secret.pdf (no fishing files!).

for instance, user clicks on link, , gets kgsjgldsg.pdf. user b clicks same link, gets asadsfsefaw.pdf. point is, random filename used reference same file, secret.pdf.

ive googled php file obfuscator, , joomla filename obfuscator, , have had no luck. ideas or pointer in right direction much appreciated.

you add together get variable based on time, valid 1 min (should enough).

so request /pdf/getpdf.php?key=xxxxxxxxx

make key salted hash based on current time on server, instance closest number dividable 5 (when it's 17:17 you'd utilize 17:15, etc).

then generations 'current' hash on getpdf.php file, , if same, stream pdf.

this not stop people using link, link valid 5 minutes.

addendum: should create sure pdf not reachable outside, readable pdf-streaming php-file (e.g. outside /var/www or equivalent directory)

php joomla

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -