PHP code example of jazzman / wp-password-argon

1. Go to this page and download the library: Download jazzman/wp-password-argon library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jazzman / wp-password-argon example snippets


User enters password
    ↓
SHA-512 HMAC with WordPress salt
    ↓
Argon2i hashing with memory cost
    ↓
Stored in database

User login attempt
    ↓
Check if password uses Argon2i
    ↓
├─ Yes → Verify with password_verify()
└─ No (old MD5) → Verify with PHPass
                 → Rehash with Argon2i
                 → Update database

add_filter('wp_hash_password_options', function() {
    return [
        'memory_cost' => PASSWORD_ARGON2_DEFAULT_MEMORY_COST,
        'time_cost'   => PASSWORD_ARGON2_DEFAULT_TIME_COST,
        'threads'     => PASSWORD_ARGON2_DEFAULT_THREADS,
    ];
});