Lines Matching refs:plaintext

1141      * @param string $plaintext
1144 public function encrypt($plaintext) argument
1147 $plaintext = $this->pad($plaintext);
1158 $ciphertext = $cipher->encrypt($plaintext);
1175 $ciphertext = $cipher->encrypt($plaintext);
1183 …return openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA | OPEN…
1185 …return openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA | OPEN…
1187 …$result = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA | O…
1193 … return $this->openssl_ctr_process($plaintext, $this->encryptIV, $this->enbuffer);
1205 $len = strlen($plaintext);
1220 $ciphertext = substr($iv, $orig_pos) ^ $plaintext;
1222 $plaintext = substr($plaintext, $i);
1228 …$ciphertext .= openssl_encrypt(substr($plaintext, 0, -$overflow) . str_repeat("\0", $this->block_s…
1232 $block = $iv ^ substr($plaintext, -$overflow);
1237 …$ciphertext = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA…
1243 …$ciphertext = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA…
1254 $len = strlen($plaintext);
1259 $ciphertext .= $plaintext[$i] ^ $xor;
1268 … return $this->openssl_ofb_process($plaintext, $this->encryptIV, $this->enbuffer);
1287 $len = strlen($plaintext);
1302 $ciphertext = substr($iv, $orig_pos) ^ $plaintext;
1312 … $ciphertext .= mcrypt_generic($this->enmcrypt, substr($plaintext, $i, $len - $len % $block_size));
1317 … $iv = mcrypt_generic($this->ecb, $iv) ^ substr($plaintext, $i, $block_size);
1327 $block = $iv ^ substr($plaintext, -$len);
1338 $ciphertext = mcrypt_generic($this->enmcrypt, $plaintext);
1351 return $inline('encrypt', $plaintext);
1359 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
1360 $ciphertext .= $this->encryptBlock(substr($plaintext, $i, $block_size));
1365 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
1366 $block = substr($plaintext, $i, $block_size);
1378 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
1379 $block = substr($plaintext, $i, $block_size);
1388 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
1389 $block = substr($plaintext, $i, $block_size);
1397 if ($start = strlen($plaintext) % $block_size) {
1412 $len = strlen($plaintext);
1427 $ciphertext = substr($iv, $orig_pos) ^ $plaintext;
1431 $iv = $this->encryptBlock($iv) ^ substr($plaintext, $i, $block_size);
1438 $block = $iv ^ substr($plaintext, $i);
1446 $len = strlen($plaintext);
1450 $ciphertext .= ($c = $plaintext[$i] ^ $this->encryptBlock($iv));
1464 $len = strlen($plaintext);
1469 $ciphertext .= $plaintext[$i] ^ $xor;
1480 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
1481 $block = substr($plaintext, $i, $block_size);
1490 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
1492 $ciphertext .= substr($plaintext, $i, $block_size) ^ $xor;
1498 if ($start = strlen($plaintext) % $block_size) {
1504 $ciphertext = $this->encryptBlock($plaintext);
1545 $plaintext = $cipher->decrypt($ciphertext);
1560 $plaintext = $cipher->decrypt($ciphertext);
1565 return $plaintext;
1571 …$plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA…
1574 …$plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA…
1578 …$plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA…
1584 … $plaintext = $this->openssl_ctr_process($ciphertext, $this->decryptIV, $this->debuffer);
1589 $plaintext = '';
1612 $plaintext = substr($iv, $orig_pos) ^ $ciphertext;
1618 …$plaintext .= openssl_decrypt(substr($ciphertext, 0, -$overflow), $this->cipher_name_openssl, $thi…
1623 $plaintext .= $iv ^ substr($ciphertext, -$overflow);
1627 …$plaintext .= openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DAT…
1632 …$plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA…
1642 $plaintext = '';
1648 $plaintext .= $ciphertext[$i] ^ $xor;
1657 … $plaintext = $this->openssl_ofb_process($ciphertext, $this->decryptIV, $this->debuffer);
1660 return $this->paddable ? $this->unpad($plaintext) : $plaintext;
1676 $plaintext = '';
1691 $plaintext = substr($iv, $orig_pos) ^ $ciphertext;
1696 $plaintext .= mcrypt_generic($this->ecb, $iv . $cb) ^ $cb;
1702 $plaintext .= $iv ^ substr($ciphertext, -$len);
1709 return $plaintext;
1712 $plaintext = mdecrypt_generic($this->demcrypt, $ciphertext);
1720 return $this->paddable ? $this->unpad($plaintext) : $plaintext;
1731 $plaintext = '';
1735 $plaintext .= $this->decryptBlock(substr($ciphertext, $i, $block_size));
1742 $plaintext .= $this->decryptBlock($block) ^ $xor;
1759 $plaintext .= $block ^ $key;
1766 $plaintext .= $block ^ $key;
1799 $plaintext = substr($iv, $orig_pos) ^ $ciphertext;
1805 $plaintext .= $iv ^ $cb;
1812 $plaintext .= $iv ^ substr($ciphertext, $i);
1818 $plaintext = '';
1823 $plaintext .= $ciphertext[$i] ^ $this->encryptBlock($iv);
1836 $plaintext = '';
1842 $plaintext .= $ciphertext[$i] ^ $xor;
1860 $plaintext .= $block ^ $key;
1865 $plaintext .= substr($ciphertext, $i, $block_size) ^ $xor;
1877 $plaintext = $this->decryptBlock($ciphertext);
1880 return $this->paddable ? $this->unpad($plaintext) : $plaintext;
1973 * @param string $plaintext
1979 private function openssl_ctr_process($plaintext, &$encryptIV, &$buffer) argument
1989 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
1990 $block = substr($plaintext, $i, $block_size);
1999 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
2000 $block = substr($plaintext, $i, $block_size);
2008 if ($start = strlen($plaintext) % $block_size) {
2017 $ciphertext = $plaintext ^ Strings::shift($buffer['ciphertext'], strlen($plaintext));
2018 $plaintext = substr($plaintext, strlen($ciphertext));
2020 if (!strlen($plaintext)) {
2025 $overflow = strlen($plaintext) % $block_size;
2027 …$plaintext2 = Strings::pop($plaintext, $overflow); // ie. trim $plaintext to a multiple of $block_…
2028 …$encrypted = openssl_encrypt($plaintext . str_repeat("\0", $block_size), $this->cipher_name_openss…
2036 …$ciphertext .= openssl_encrypt($plaintext . str_repeat("\0", $block_size), $this->cipher_name_open…
2061 * @param string $plaintext
2067 private function openssl_ofb_process($plaintext, &$encryptIV, &$buffer) argument
2070 $ciphertext = $plaintext ^ $buffer['xor'];
2072 $plaintext = substr($plaintext, strlen($ciphertext));
2079 $len = strlen($plaintext);
2083 if (strlen($plaintext)) {
2085 …$ciphertext .= openssl_encrypt(substr($plaintext, 0, -$overflow) . str_repeat("\0", $block_size), …
2090 $ciphertext .= Strings::shift($xor, $overflow) ^ substr($plaintext, -$overflow);
2095 …$ciphertext = openssl_encrypt($plaintext, $this->cipher_name_openssl, $key, OPENSSL_RAW_DATA | OPE…
2097 … $encryptIV = substr($ciphertext, -$block_size) ^ substr($plaintext, -$block_size);