function ryzom_encrypt($key, $passphrase = '')
{
    if ($passphrase == '') {
        $passphrase = ryzom_generate_passphrase();
    }
    return rtrim(strtr(AESEncryptCtr($key, $passphrase, 256), '+/', '-_'), '=');
}
示例#2
0
function new_fork($type, $number_operations, $data, $account_code)
{
    global $mysqli;
    $fork_encrypt_key = md5('huls0fjhslsshskslgjbtqcwijnbxhl2391');
    $token = substr(str_shuffle(md5(time()) . rand() . str_shuffle('qwertyuiopasdfghjjklmnbvcxzQWERTYUIOPKJHGFDSAZXCVBNM1234567890')), 0, 64);
    $sql = sprintf("insert into `Fork Dimension`  (`Fork Process Data`,`Fork Token`,`Fork Type`,`Fork Operations Total Operations`) values (%s,%s,%s,%d)  ", prepare_mysql(json_encode($data)), prepare_mysql($token), prepare_mysql($type), $number_operations);
    $salt = md5(rand());
    $mysqli->query($sql);
    $fork_key = $mysqli->insert_id;
    $fork_metadata = base64_encode(AESEncryptCtr(json_encode(array('code' => addslashes($account_code), 'token' => $token, 'fork_key' => $fork_key, 'salt' => $salt)), $fork_encrypt_key, 256));
    $client = new GearmanClient();
    $client->addServer('127.0.0.1');
    $msg = $client->doBackground($type, $fork_metadata);
    return array($fork_key, $msg);
}
function encrypt($info, $encryptPass)
{
    return AESEncryptCtr($info, $encryptPass);
}
function encrypt($info)
{
    if (ENCRYPT_ENABLE) {
        if (ENCRYPT_TYPE === "AES") {
            require_once "aes.php";
            $info = AESEncryptCtr($info, ENCRYPT_PASS);
        } else {
            require_once "rc4.php";
            $info = base64_encode(rc4($info, ENCRYPT_PASS));
        }
    } else {
        $info = base64_encode($info);
    }
    return $info;
}
示例#5
0
function encrypt($info, $encrypt_enable, $encrypt_pass, $encrypt_type)
{
    if ($encrypt_enable) {
        if ($encrypt_type === "AES") {
            require_once "aes.php";
            $info = AESEncryptCtr($info, $encrypt_pass);
        } else {
            require_once "rc4.php";
            $info = base64_encode(rc4($info, $encrypt_pass));
        }
    } else {
        $info = base64_encode($info);
    }
    return $info;
}
示例#6
0
function encryptPass($pass)
{
    global $config;
    $key = $config['encryption']['key'];
    return AESEncryptCtr($pass, $key, 256);
}
示例#7
0
 public function protect($params)
 {
     return "shield=" . $this->removePlus(AESEncryptCtr($params, "h39oyMN9cXzKT7loxCzYIUgD4uyHt9Fvccigc39GXpTjlAfkAlPegh3lnAIqJRDnAmJwc91WtwPHSs", 256));
 }
<?php

// from www.movable-type.co.uk/scripts/aes-php.html
require 'aes-lib.php';
echo AESEncryptCtr($_POST['plain'], $_POST['key'], 256);
?>
 
示例#9
0
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
abcdefghijklmnopqrstuvwxyz,-ABCDEFGHIJKLMNOPQRSTUVWXYZ,-1234567890.
EOF;
$password = "******";
for ($i = 0; $i >= 5; $i++) {
    $plainText .= $plainText;
}
$cipherText = AESEncryptCtr($plainText, $password, 256);
$decryptedText = AESDecryptCtr($cipherText, $password, 256);
示例#10
0
文件: mail.php 项目: NejcZdovc/sumo2
$isNoUpdateFile = 1;
require_once '../initialize.php';
$security->checkMin();
if (ob_get_length() > 0) {
    ob_end_clean();
}
if ($db->is('type')) {
    $id = $user->id;
    if ($db->filter('type') == 'send') {
        $recipients = $db->filter('recipient');
        $array = preg_split("/!/", $recipients);
        $subject = $db->filter('subject');
        $content = $db->filter('content');
        $content = AESEncryptCtr($content, code_hidden_full, 256);
        $subject = AESEncryptCtr($subject, code_hidden_full, 256);
        $query = $db->query('INSERT INTO cms_mail_main (senderID, subject, content) VALUES (' . $id . ', "' . $subject . '", "' . $content . '")');
        $last_insert = $db->getLastId();
        foreach ($array as $value) {
            if ($valid->isNumber($value)) {
                $db->query('INSERT INTO cms_mail_sent (recipientID, mainID, status) VALUES (' . $value . ', ' . $last_insert . ', "C")');
            }
        }
        echo "Ok";
        exit;
    }
    if ($db->filter('type') == 'remi') {
        $idmail = $crypt->decrypt($db->filter('idmail'));
        $db->query("UPDATE cms_mail_sent SET status='D' WHERE ID='" . $idmail . "'");
        echo "Ok";
        exit;
示例#11
0
     }
     $tempHolder = $arrayCounter - 1;
     $arrayCounter = 1;
     foreach ($modXml->accordion->item as $accordion) {
         echo "" . $accordion->uniqueId . ":" . ($arrayCounter + $tempHolder - 1) . ($arrayCounter == count($modXml->accordion->item) ? "" : ",") . "";
         echo "\n";
         $arrayCounter++;
     }
     echo "}";
     echo "\n";
     echo "};";
     echo "\n";
 } else {
     $output = "";
     $output .= "sumo2.language.GetLanguage();";
     $output .= "sumo2.accordion.MAX_PANELS='" . AESEncryptCtr($user->accordion, "h39oyMN9cXzKT7loxCzYIUgD4uyHt9Fvccigc39GXpTjlAfkAlPegh3lnAIqJRDnAmJwc91WtwPHSs", 256) . "';";
     $output .= "var editor_number=\"56065605650\";";
     $output .= "sumo2.settings={";
     $output .= "ADMIN_ROOT:\"" . ADMIN_ADDR . "\",";
     $output .= "DOC_ROOT:\"" . SITE_ROOT . SITE_FOLDER . "\",";
     $output .= "DIALOGS:Array(";
     $counter1 = 1;
     $counter2 = 1;
     foreach ($xml->dialog->item as $dialog) {
         $counter2 = 1;
         $output .= "{";
         $output .= "refresh:" . $dialog->refresh . ",";
         $output .= "close:" . $dialog->close . ",";
         $output .= "uniqueId:\"" . $dialog->uniqueId . "\",";
         $output .= "title:" . (strpos($dialog->title, "sumo2.language") === false ? "\"" . $dialog->title . "\"" : $dialog->title) . ",";
         $output .= "page:\"" . $dialog->page . "\",";