« sodium_crypto_generichash_update
sodium_crypto_kdf_keygen »

sodium_crypto_kdf_derive_from_key

(PHP 7 >= 7.2.0, PHP 8)

sodium_crypto_kdf_derive_from_key — サブキーを派生させる

説明

function sodium_crypto_kdf_derive_from_key(
    int $subkey_length,
    int $subkey_id,
    string $context,
    #[\SensitiveParameter] string $key
): string

ルートキーと追加のコンテクストから、サブキーを派生させます。

hash_hkdf() に似ています。

パラメータ

subkey_length

返すキーの長さ(バイト単位)

subkey_id

与えられたルートキーから返されるN番目のサブキーのID。 シークさせる時に便利です。

context

アプリケーション特有のコンテクスト

key

サブキーを派生させるルートキー

戻り値

擬似ランダムな(生のバイナリの)バイト列を文字列として返します。

関連キーワード:
サブキー   派生   sodium   crypto   subkey   derive   ルートキー   length   context   コンテクスト   バイト   generichash   update   keygen   Sodium   SensitiveParameter   hash   hkdf   キー   単位   シーク   便利   アプリケーション   擬似   ランダム
関連する関数・ページ:
function.sodium-crypto-kdf-keygen   function.sodium-crypto-stream-keygen   function.sodium-crypto-auth-keygen   function.sodium-crypto-box-seed-keypair   function.sodium-crypto-shorthash-keygen   function.sodium-crypto-stream