コード例 #1
0
ファイル: cookie.class.php プロジェクト: vernsix/ipinga
 public static function decrypt($encryptedString)
 {
     $clearText = \ipinga\crypto::decrypt($encryptedString);
     $a = json_decode($clearText, true);
     return $a;
 }
コード例 #2
0
ファイル: crypto.class.php プロジェクト: vernsix/ipinga
 /**
  * @param string $encryptedString (created by printableEncrypt())
  *
  * @return array Decrypted original value
  */
 public static function printableDecrypt($encryptedString)
 {
     $a = json_decode(\ipinga\crypto::decrypt(hex2bin($encryptedString)), true);
     return $a['k'];
 }
コード例 #3
0
ファイル: table.class.php プロジェクト: vernsix/ipinga
 /**
  * Some other function prepares this and does all the binding.  All I am doing here is executing it in a common
  * fashion and populating all the fields() array
  *
  * @param \PDOStatement $stmt
  */
 protected function _process_loadby_execute($stmt)
 {
     try {
         $stmt->execute();
         $row = $stmt->fetch(\PDO::FETCH_ASSOC);
         foreach ($this->fieldTypes as $fieldName => $fieldType) {
             if ($fieldName == 'passwd') {
                 $this->field[$fieldName] = \ipinga\crypto::decrypt(hex2bin($row['passwd']));
             } else {
                 $this->field[$fieldName] = $row[$fieldName];
             }
         }
         if ($this->field['id'] < 1) {
             $this->saved = false;
         } else {
             $this->saved = true;
         }
     } catch (\Exception $e) {
         echo $e->getMessage() . '<br><hr>';
         $this->saved = false;
     }
 }