Lines Matching refs:plaintext
83 * @param string $plaintext
86 public function encrypt($plaintext) argument
91 return $this->encrypt_with_libsodium($plaintext);
94 return parent::encrypt($plaintext);
123 * @param string $plaintext
126 private function encrypt_with_libsodium($plaintext) argument
128 $params = [$plaintext, $this->aad, $this->nonce, $this->key];
133 return substr($ciphertext, 0, strlen($plaintext));
136 $newciphertext = substr($ciphertext, 0, strlen($plaintext));
139 substr($ciphertext, strlen($plaintext)) :
161 $plaintext = sodium_crypto_aead_chacha20poly1305_ietf_decrypt(...$params);
163 if ($plaintext === false) {
166 return $plaintext;
176 $plaintext = strlen($this->nonce) == 8 ?
180 return substr($plaintext, 0, strlen($ciphertext));