コード例 #1
0
 /**
  * Encrypts a message.
  *
  * @see    Crypt_Base::decrypt()
  * @see    Crypt_RC4::_crypt()
  * @access public
  *
  * @param String $plaintext
  *
  * @return String $ciphertext
  */
 function encrypt($plaintext)
 {
     if ($this->engine == CRYPT_MODE_MCRYPT) {
         return parent::encrypt($plaintext);
     }
     return $this->_crypt($plaintext, CRYPT_RC4_ENCRYPT);
 }
コード例 #2
0
ファイル: RC2.php プロジェクト: Krassmus/LehrMarktplatz
 /**
  * Encrypts a message.
  *
  * Mostly a wrapper for Crypt_Base::encrypt, with some additional OpenSSL handling code
  *
  * @see self::decrypt()
  * @access public
  * @param string $plaintext
  * @return string $ciphertext
  */
 function encrypt($plaintext)
 {
     if ($this->engine == CRYPT_ENGINE_OPENSSL) {
         $temp = $this->key;
         $this->key = $this->orig_key;
         $result = parent::encrypt($plaintext);
         $this->key = $temp;
         return $result;
     }
     return parent::encrypt($plaintext);
 }
コード例 #3
0
ファイル: RC4.php プロジェクト: smutt/HOBA-server
 /**
  * Encrypts a message.
  *
  * @see Crypt_Base::decrypt()
  * @see self::_crypt()
  * @access public
  * @param string $plaintext
  * @return string $ciphertext
  */
 function encrypt($plaintext)
 {
     if ($this->engine != CRYPT_ENGINE_INTERNAL) {
         return parent::encrypt($plaintext);
     }
     return $this->_crypt($plaintext, CRYPT_RC4_ENCRYPT);
 }
コード例 #4
0
 /**
  * {@inheritDoc}
  */
 public function transform(AttributeEvent $event)
 {
     $value = $event->getValue();
     $event->setValue($this->cipher->encrypt($value));
 }