예제 #1
0
 public function decrypttest()
 {
     // set timezone just in case
     date_default_timezone_set('UTC');
     // Get some test data to encrypt, this is an ISO 8601 timestamp
     $toEncrypt = date('c');
     // get the key from the session
     $key = $_SESSION[self::SESSION_KEY];
     $encrypted = sqAES::crypt($key, $toEncrypt);
     Header('Content-type: application/json');
     echo json_encode(array('encrypted' => $encrypted, 'unencrypted' => $toEncrypt));
     exit;
 }
예제 #2
0
 private function encrypt($input)
 {
     return sqAES::crypt($this->securekey, $input);
 }