diesel225 Posted March 9, 2007 Share Posted March 9, 2007 Hi, I have 2 php files, #1 with 2 variables, and #2 that reads those var and uses them. The thing that i'm not sure how to tackle is that file #1 has sensitive data and must be as secure as possible (possibly encrypted and only read by the file #2). Can anyone point me in the right direction of how to encrypt the file #1 and provide the ability for the file #2 to securely read it? Thanks for your help. Link to comment https://forums.phpfreaks.com/topic/41891-php-and-file-encryptionsecurity/ Share on other sites More sharing options...
Archadian Posted March 9, 2007 Share Posted March 9, 2007 on your index.php file at the top put this: define('SOMETHING_HERE', true); then at the top of every script that you want secure put this: if (!defined('SOMETHING_HERE')) { // checks to see if SOMETHING_HERE is true or not die('Restricted!'); // SOMETHING_HERE was not defined as TRUE } else { // your sensitive data here. } This works with includes on your index.php Hopefully this is what you were asking for. Link to comment https://forums.phpfreaks.com/topic/41891-php-and-file-encryptionsecurity/#findComment-203109 Share on other sites More sharing options...
skali Posted March 9, 2007 Share Posted March 9, 2007 http://php.net/mcrypt Link to comment https://forums.phpfreaks.com/topic/41891-php-and-file-encryptionsecurity/#findComment-203119 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.