Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host="localhost";
- $username="";
- $password="";
- $db_name="";
- $key="";
- $tbl_name="login";
- $IP = $_SERVER['REMOTE_ADDR'];
- mysql_connect("$host", "$username", "$password")or die("cannot connect");
- mysql_select_db("$db_name")or die("cannot select DB");
- $HWID = $_GET['HWID'];
- $sql="SELECT * FROM $tbl_name WHERE HWID='$HWID'";
- $result=mysql_query($sql);
- $count=mysql_num_rows($result);
- if($count==1){
- echo rc4Encrypt("Code")
- }else{
- echo rc4Encrypt("Code")
- }
- function rc4Encrypt($key, $pt) {
- $s = array();
- for ($i=0; $i<256; $i++) {
- $s[$i] = $i;
- }
- $j = 0;
- $x;
- for ($i=0; $i<256; $i++) {
- $j = ($j + $s[$i] + ord($key[$i % strlen($key)])) % 256;
- $x = $s[$i];
- $s[$i] = $s[$j];
- $s[$j] = $x;
- }
- $i = 0;
- $j = 0;
- $ct = '';
- $y;
- for ($y=0; $y<strlen($pt); $y++) {
- $i = ($i + 1) % 256;
- $j = ($j + $s[$i]) % 256;
- $x = $s[$i];
- $s[$i] = $s[$j];
- $s[$j] = $x;
- $ct .= $pt[$y] ^ chr($s[($s[$i] + $s[$j]) % 256]);
- }
- return $ct;
- }
- function rc4Decrypt($key, $ct) {
- return rc4Encrypt($key, $ct);
- }
- ?>
Add Comment
Please, Sign In to add comment