/** * Gather saved credit card numbers from sales order payments and re-encrypt them * */ protected function _reEncryptCreditCardNumbers() { $table = $this->getTable('sales/order_payment'); $select = $this->_getWriteAdapter()->select()->from($table, array('entity_id', 'cc_number_enc')); $attributeValues = $this->_getWriteAdapter()->fetchPairs($select); // save new values foreach ($attributeValues as $valueId => $value) { $this->_getWriteAdapter()->update($table, array('cc_number_enc' => $this->_encryptor->encrypt($this->_encryptor->decrypt($value))), array('entity_id = ?' => (int) $valueId)); } }
/** * Look for key and crypt versions in encrypted data before decrypting * * @param string $data * @return string */ public function decrypt($data) { return parent::decrypt($this->_keyVersion . ':' . self::CIPHER_LATEST . ':' . $data); }
public function validateLegacyHash($password, $hash) { return parent::validateHash($password, $hash); }