Пример #1
0
 private function readLicence($licencekey)
 {
     $c = "";
     if (strpos($licencekey, "|") == false) {
         return false;
     }
     list($pre, $c) = explode("|", $licencekey);
     if (empty($c)) {
         return false;
     }
     $modulus = "247951816413205085921106286398120136896788014055199338629780778472204077308053767006218018324142651909195596003106594609159002643031774387211432583166542583483099049359378164797170552666392349957500492002826361302903529659499530039.0000000000";
     $public = "65537";
     $keylength = "768";
     Ibos::import("ext.auth.RSA", true);
     $RSA = new RSA();
     $pre = base64_decode($pre);
     $key = $RSA->verify($pre, $public, $modulus, $keylength);
     $key = trim($key, "");
     Ibos::import("ext.auth.AES", true);
     $AES = new AES(true);
     $keys = $AES->makeKey($key);
     $s = $AES->decryptString($c, $keys);
     $s = json_decode($s, true);
     return $s;
 }