Exemplo n.º 1
0
/**
 * 加密文件
 * $file 需要加密的文件的路径
 * $filename 加密之后的文件名称
 */
function encrypfile($file)
{
    !$file && ($file = dirname(__FILE__) . '/indexSuccess.php');
    $content = file_get_contents($file);
    $encryp = encryption($content);
    $decryp = decryption($encryp);
    return $encryp . '*******' . $decryp;
}
Exemplo n.º 2
0
function pay($to, $amount, $comment)
{
    $settings = $GLOBALS["settings"];
    $myHashKey = $GLOBALS["hashKey"];
    $serviceUrl = "https://api.xapo.com/v1";
    $xapo_app_id = trim(decryption($myHashKey, $settings['xapo_app_id']));
    $xapo_secret_key = trim(decryption($myHashKey, $settings['xapo_secret_key']));
    // $creditAPI = new XapoCreditAPI($serviceUrl, $xapo_app_id, $xapo_secret_key);
    $creditAPI = new XapoCreditAPI($serviceUrl, $settings['xapo_app_id'], $settings['xapo_secret_key']);
    $currency = "SAT";
    // SAT | BTC
    $unique_request_id = uniqid();
    $ret = $creditAPI->credit($to, $currency, $unique_request_id, $amount, $comments);
    /*   $amount = $amount * 0.01;
        $unique_request_id = uniqid();
        $to="*****@*****.**";
    	
    	//$to = "*****@*****.**" ;
    	
    	
        $ret = $creditAPI->credit($to, $currency, $unique_request_id, $amount, "Thank you for using Faucet Builder");
      */
    return $ret;
}
Exemplo n.º 3
0
        if (isset($_POST["new_xapo_app_id"])) {
            if ($_SESSION['admin']) {
                if ($_POST["new_xapo_app_id"] != "" && $_POST["new_xapo_secret_key"] != "") {
                    $updateKeys = update_keys_query();
                    $q = $sql->prepare($updateKeys);
                    $xapo_key = encryption($myHashKey, $_POST["new_xapo_app_id"]);
                    $xapo_secret = encryption($myHashKey, $_POST["new_xapo_secret_key"]);
                    $q->execute(array($xapo_key, $xapo_secret));
                    $q->closeCursor();
                    $view["admin_message_html"] = '<div class="alert alert-success" role="alert">Keys changed successfully.</div>';
                } else {
                    $view["admin_message_html"] = '<div class="alert alert-danger" role="alert">Keys can\'t be empty.</div>';
                }
            }
        }
    }
}
$queryGeneralSettings = "select * from settings where name<>'password'";
$resultSettings = $sql->query($queryGeneralSettings);
if ($resultSettings) {
    while ($row = $resultSettings->fetch()) {
        if ($row['name'] == "xapo_app_id" || $row['name'] == "xapo_secret_key") {
            $decriptedKey = trim(decryption($myHashKey, $row['value']));
            $hiddenKey = hide_key($decriptedKey);
            $settings[$row['name']] = $hiddenKey;
        } else {
            $settings[$row['name']] = $row['value'];
        }
    }
}
require 'template/index.php';
Exemplo n.º 4
0
        $stmt->execute();
        $stmt->bind_result($field1, $value1);
        while ($stmt->fetch()) {
            $val_decrypt = decryption($value1);
            echo $field1 . "\t" . $val_decrypt . "\n";
        }
    }
} else {
    //currUser, user, user, currUser, currUser
    //returns the password of the currUsers profile only if currUser is friends with user.
    $fullCheckSQL = "SELECT u.password FROM users as u JOIN friends as f ON u.username=f.user1 OR u.username=f.user2 WHERE ((f.user1=? and f.user2=?) OR (f.user1=? and f.user2=?)) and u.username=?";
    $stmt->prepare($fullCheckSQL);
    $stmt->bind_param('sssss', $currUser, $user, $user, $currUser, $currUser);
    $stmt->execute();
    $stmt->bind_result($pass_return2);
    $stmt->fetch();
    //will fail if passwords do not match
    if (pass_check($currPass, $pass_return2)) {
        //user
        $profileSQL2 = "SELECT field,value FROM profile WHERE user=?";
        $stmt->prepare($profileSQL2);
        $stmt->bind_param('s', $user);
        $stmt->execute();
        $stmt->bind_result($field2, $value2);
        while ($stmt->fetch()) {
            $val_dec = decryption($value2);
            echo $field2 . ":" . $val_dec . "\n";
        }
    }
}
mysqli_close($con);
Exemplo n.º 5
0
function pay($to, $amount, $comment)
{
    $settings = $GLOBALS["settings"];
    $myHashKey = $GLOBALS["hashKey"];
    $serviceUrl = "https://api.xapo.com/v1";
    $xapo_app_id = trim(decryption($myHashKey, $settings['xapo_app_id']));
    $xapo_secret_key = trim(decryption($myHashKey, $settings['xapo_secret_key']));
    $creditAPI = new XapoCreditAPI($serviceUrl, $xapo_app_id, $xapo_secret_key);
    $currency = "SAT";
    // SAT | BTC
    $unique_request_id = uniqid();
    $ret = $creditAPI->credit($to, $currency, $unique_request_id, $amount, $comments);
    return $ret;
}