• Log in or sign up for an account here: https://www.sythe.org/login

[PHP] RC4 Encrypted IP Logging

kRaeTwin

Newcomer
Joined
Dec 26, 2010
Sythe Gold
0
Messages
1
Age
32
Location
Scotland
[PHP] RC4 Encrypted IP Logging
This is my first post on this forum, so I hope you enjoy it.

Download this PHP class (not written by me; credits inside it). Make sure to include our class inside the web folder, and that we have a html file in our folder also. Call the html file "log".

Then we use the following code on our page:

Code:
$ip = $_SERVER['REMOTE_ADDR'];
$date = date("d-m-y / H:i:s");
$crypto = &new RC4();
$eIp = $crypto->encrypt("ENCRYPTION KEY", $ip);
$eDate = $crypto->encrypt("ENCRYPTION KEY", $date);
$file = fopen("log.html", "a");
fwrite($file, "IP Address: " . $eIp . "<br />" . "Date: " . $eDate . "<br /><br />");

That will RC4 Encrypt our log so that no one knows who visited the certain page and what time. You can add things to it such as the page it was referred by etc.
Using this method is an alternative to using MySQL to log.

MAKE SURE TO REMEMBER YOUR KEY, OTHERWISE IT WILL BE ALMOST IMPOSSIBLE TO RECOVER THE DATA.

- kRaeTwin :love:
 
Runescape Gamblingrunescape gambling
Back
Top