« sodium_crypto_stream_xchacha20_xor_ic
sodium_hex2bin »

sodium_crypto_stream_xor

(PHP 7 >= 7.2.0, PHP 8)

sodium_crypto_stream_xor — 認証を行わずにメッセージを暗号化する

説明

function sodium_crypto_stream_xor(#[\SensitiveParameter] string $message, string $nonce, #[\SensitiveParameter] string $key): string

この関数は XSalsa20 を用いて暗号化を行いますが、 プレーンテキストについて、 いかなる暗号学的な保証も行いません。

パラメータ

message

暗号化するメッセージ

nonce

メッセージごとに一度だけ使われる数値。 長さは24バイトです。 これは、 (たとえば、random_bytes()を使って) ランダムな値を生成するのに十分大きな長さです。

key

暗号化キー(256ビット)

戻り値

暗号化されたメッセージを返します。

関連キーワード:
暗号化   メッセージ   sodium   crypto   stream   認証   SensitiveParameter   message   nonce   xchacha   Sodium   XSalsa   プレーン   テキスト   暗号   保証   一度   数値   バイト   random   bytes   ランダム   キー   ビット
関連する関数・ページ:
function.sodium-crypto-stream-xchacha20-xor   function.sodium-crypto-box   function.sodium-crypto-stream-xchacha20-xor-ic   function.sodium-crypto-aead-aes256gcm-encrypt   function.sodium-crypto-aead-aegis128l-encrypt   function.sodium-crypto-aead-aegis256-encrypt