Lines Matching refs:plaintext

686      * @param string $plaintext
690 function encrypt($plaintext) argument
693 $plaintext = $this->_pad($plaintext);
703 …return openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options);
705 …$result = @openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_opti…
708 …$result = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_optio…
717 … return $this->_openssl_ctr_process($plaintext, $this->encryptIV, $this->enbuffer);
729 $len = strlen($plaintext);
744 $ciphertext = substr($iv, $orig_pos) ^ $plaintext;
746 $plaintext = substr($plaintext, $i);
752 …$ciphertext.= openssl_encrypt(substr($plaintext, 0, -$overflow) . str_repeat("\0", $this->block_si…
756 $block = $iv ^ substr($plaintext, -$overflow);
761 …$ciphertext = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_o…
767 …$ciphertext = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_o…
777 … return $this->_openssl_ofb_process($plaintext, $this->encryptIV, $this->enbuffer);
800 $len = strlen($plaintext);
815 $ciphertext = substr($iv, $orig_pos) ^ $plaintext;
825 … $ciphertext.= mcrypt_generic($this->enmcrypt, substr($plaintext, $i, $len - $len % $block_size));
830 … $iv = mcrypt_generic($this->ecb, $iv) ^ substr($plaintext, $i, $block_size);
840 $block = $iv ^ substr($plaintext, -$len);
851 $ciphertext = mcrypt_generic($this->enmcrypt, $plaintext);
868 return $inline('encrypt', $this, $plaintext);
876 for ($i = 0; $i < strlen($plaintext); $i+=$block_size) {
877 $ciphertext.= $this->_encryptBlock(substr($plaintext, $i, $block_size));
882 for ($i = 0; $i < strlen($plaintext); $i+=$block_size) {
883 $block = substr($plaintext, $i, $block_size);
895 for ($i = 0; $i < strlen($plaintext); $i+=$block_size) {
896 $block = substr($plaintext, $i, $block_size);
905 for ($i = 0; $i < strlen($plaintext); $i+=$block_size) {
906 $block = substr($plaintext, $i, $block_size);
914 if ($start = strlen($plaintext) % $block_size) {
929 $len = strlen($plaintext);
944 $ciphertext = substr($iv, $orig_pos) ^ $plaintext;
948 $iv = $this->_encryptBlock($iv) ^ substr($plaintext, $i, $block_size);
955 $block = $iv ^ substr($plaintext, $i);
963 $len = strlen($plaintext);
967 $ciphertext .= ($c = $plaintext[$i] ^ $this->_encryptBlock($iv));
982 for ($i = 0; $i < strlen($plaintext); $i+=$block_size) {
983 $block = substr($plaintext, $i, $block_size);
992 for ($i = 0; $i < strlen($plaintext); $i+=$block_size) {
994 $ciphertext.= substr($plaintext, $i, $block_size) ^ $xor;
1000 if ($start = strlen($plaintext) % $block_size) {
1006 $ciphertext = $this->_encryptBlock($plaintext);
1040 …$plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_o…
1046 …$plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_o…
1056 …$plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_o…
1062 … $plaintext = $this->_openssl_ctr_process($ciphertext, $this->decryptIV, $this->debuffer);
1067 $plaintext = '';
1090 $plaintext = substr($iv, $orig_pos) ^ $ciphertext;
1096 …$plaintext.= openssl_decrypt(substr($ciphertext, 0, -$overflow), $this->cipher_name_openssl, $this…
1101 $plaintext.= $iv ^ substr($ciphertext, -$overflow);
1105 …$plaintext.= openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_o…
1110 …$plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_o…
1120 … $plaintext = $this->_openssl_ofb_process($ciphertext, $this->decryptIV, $this->debuffer);
1123 return $this->paddable ? $this->_unpad($plaintext) : $plaintext;
1142 $plaintext = '';
1157 $plaintext = substr($iv, $orig_pos) ^ $ciphertext;
1162 $plaintext.= mcrypt_generic($this->ecb, $iv . $cb) ^ $cb;
1168 $plaintext.= $iv ^ substr($ciphertext, -$len);
1175 return $plaintext;
1178 $plaintext = mdecrypt_generic($this->demcrypt, $ciphertext);
1186 return $this->paddable ? $this->_unpad($plaintext) : $plaintext;
1201 $plaintext = '';
1205 $plaintext.= $this->_decryptBlock(substr($ciphertext, $i, $block_size));
1212 $plaintext.= $this->_decryptBlock($block) ^ $xor;
1229 $plaintext.= $block ^ $key;
1236 $plaintext.= $block ^ $key;
1269 $plaintext = substr($iv, $orig_pos) ^ $ciphertext;
1275 $plaintext.= $iv ^ $cb;
1282 $plaintext.= $iv ^ substr($ciphertext, $i);
1288 $plaintext = '';
1293 $plaintext .= $ciphertext[$i] ^ $this->_encryptBlock($iv);
1315 $plaintext.= $block ^ $key;
1320 $plaintext.= substr($ciphertext, $i, $block_size) ^ $xor;
1332 $plaintext = $this->_decryptBlock($ciphertext);
1335 return $this->paddable ? $this->_unpad($plaintext) : $plaintext;
1348 * @param string $plaintext
1354 function _openssl_ctr_process($plaintext, &$encryptIV, &$buffer) argument
1364 for ($i = 0; $i < strlen($plaintext); $i+=$block_size) {
1365 $block = substr($plaintext, $i, $block_size);
1376 for ($i = 0; $i < strlen($plaintext); $i+=$block_size) {
1377 $block = substr($plaintext, $i, $block_size);
1386 if ($start = strlen($plaintext) % $block_size) {
1395 … $ciphertext = $plaintext ^ $this->_string_shift($buffer['ciphertext'], strlen($plaintext));
1396 $plaintext = substr($plaintext, strlen($ciphertext));
1398 if (!strlen($plaintext)) {
1403 $overflow = strlen($plaintext) % $block_size;
1405 …$plaintext2 = $this->_string_pop($plaintext, $overflow); // ie. trim $plaintext to a multiple of $…
1406 …$encrypted = openssl_encrypt($plaintext . str_repeat("\0", $block_size), $this->cipher_name_openss…
1414 …$ciphertext.= openssl_encrypt($plaintext . str_repeat("\0", $block_size), $this->cipher_name_opens…
1442 * @param string $plaintext
1448 function _openssl_ofb_process($plaintext, &$encryptIV, &$buffer) argument
1451 $ciphertext = $plaintext ^ $buffer['xor'];
1453 $plaintext = substr($plaintext, strlen($ciphertext));
1460 $len = strlen($plaintext);
1464 if (strlen($plaintext)) {
1466 …$ciphertext.= openssl_encrypt(substr($plaintext, 0, -$overflow) . str_repeat("\0", $block_size), $…
1471 … $ciphertext.= $this->_string_shift($xor, $overflow) ^ substr($plaintext, -$overflow);
1476 …$ciphertext = openssl_encrypt($plaintext, $this->cipher_name_openssl, $key, $this->openssl_options…
1478 … $encryptIV = substr($ciphertext, -$block_size) ^ substr($plaintext, -$block_size);