« sodium_memzero
sodium_unpad »

sodium_pad

(PHP 7 >= 7.2.0, PHP 8)

sodium_pad — パディングデータを追加する

説明

function sodium_pad(#[\SensitiveParameter] string $string, int $block_size): string

文字列の右側に、任意の長さのパディングを追加します。 タイミング攻撃に対しても安全です。

パラメータ

string

パディングされていない文字列。

block_size

ここで指定されたブロックサイズの偶数倍になるまで、 文字列にパディングが追加されます。

戻り値

パディングが追加された文字列。

関連キーワード:
sodium   パディング   パディングデータ   block   size   memzero   unpad   Sodium   SensitiveParameter   右側   任意   タイミング   攻撃   安全   ブロック   偶数
関連する関数・ページ:
function.sodium-unpad   function.sodium-memzero   function.sodium-compare   function.sodium-bin2hex   function.sodium-bin2base64   function.sodium-hex2bin