Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #21022, comment 239


Ignore:
Timestamp:
02/22/2025 12:40:00 AM (5 months ago)
Author:
paragoninitiativeenterprises
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #21022, comment 239

    initial v1  
    3030        string $message
    3131): string {
    32         $hashed = sodium_crypto_generichash( $message, 'wp_fast_hash' );
     32        $hashed = sodium_crypto_generichash( $message, 'wp_fast_hash_6.8+' );
    3333        return '$generic$' . sodium_bin2base64( $hashed, SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING );
    3434}
    3535}}}
    3636
    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.
     37That 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.
    3838
    3939Therefore, 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.)