Changes between Initial Version and Version 1 of Ticket #21022, comment 239
- Timestamp:
- 02/22/2025 12:40:00 AM (5 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #21022, comment 239
initial v1 30 30 string $message 31 31 ): string { 32 $hashed = sodium_crypto_generichash( $message, 'wp_fast_hash ' );32 $hashed = sodium_crypto_generichash( $message, 'wp_fast_hash_6.8+' ); 33 33 return '$generic$' . sodium_bin2base64( $hashed, SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING ); 34 34 } 35 35 }}} 36 36 37 That is to say, leaving the default length but setting the key to `"wp_fast_hash "` to ensure domain-separation from other code that might use BLAKE2b.37 That is to say, leaving the default length but setting the key to `"wp_fast_hash_6.8+"` to ensure domain-separation from other code that might use BLAKE2b. 38 38 39 39 Therefore, our recommendation is to not shorten the hashes. 40 41 (EDIT: I forgot that keys shorter than 16 bytes error, and amended the recommendation to include the minimum WordPress version to pad it out.)