How to display the current and parent category in WordPress
Need to show the category hierarchy in your theme? Learn how to get the current category and its parent using get_the_category() and get_category_parents().
Every PHP application with a login stores something about passwords, and Italy has a written position on how. I am Mariusz Szatkowski, a developer in Gdynia working remotely and in writing, in the same time zone as Turin. I am not a lawyer. This page reads the Garante guidelines for what they ask of the code, and maps that to the password functions in the PHP manual. The legal position is for you and your adviser.

The Mole Antonelliana above Turin, Alps in the background. Turin photo by Abbrey82, licensed CC BY-SA 4.0, via Wikimedia Commons.
On 7 December 2023 the Garante per la protezione dei dati personali adopted the “Linee Guida Funzioni Crittografiche, Conservazione delle Password” (provvedimento n. 594, doc. web 9962283). A notice appeared in the Gazzetta Ufficiale on 19 January 2024. The guidelines were prepared by the Agenzia per la Cybersicurezza Nazionale (ACN) together with the Garante office, and they carry the principles of integrity and confidentiality and the security duties of articles 5(1)(f) and 32 GDPR.
The Garante gives its reason in the recitals. Breach notifications under article 33 GDPR showed stolen username and password pairs, and its inspections found that technical measures to protect stored passwords were applied only to a limited extent. It treats the password both as personal data of the user and as a security measure.
The Garante considers the guideline measures necessary in particular when one or more of three conditions is met:
Where a controller uses other measures instead, it has to be able to prove, under the accountability principle (articles 5(2) and 24 GDPR), that they still give an adequate level of security. The Garante also invites producers of products, services and applications to design them with these measures in mind. A PHP developer who builds a login for a client is in that group.
The annex is a technical document by the ACN, published on the Garante site, dated December 2023. Its conclusions:
Table 1 of the annex sets the minimum parameters. For Argon2id it lists a salt of at least 128 bit and these combinations:
| Digest | Iterations (c) | Memory (m) | Parallelism (p) |
|---|---|---|---|
| 128 bit | 1 | 46 MiB | 1 |
| 128 bit | 2 | 19 MiB | 1 |
| 128 bit | 3 | 12 MiB | 1 |
| 128 bit | 4 | 9 MiB | 1 |
| 128 bit | 5 | 7 MiB | 1 |
| 256 bit | 1 | 2048 MiB | 4 |
| 256 bit | 3 | 64 MiB | 4 |
For PBKDF2 the table gives at least 600,000 iterations with HMAC-SHA256 or 210,000 with HMAC-SHA512. The text adds that raising the parallelism requires raising at least one of the other two Argon2id parameters, and that the values should be sized to your own computing and memory capacity, so that a single password is checked quickly and a large number of attempts becomes infeasible. The ACN states that the document reflects the threats on its publication day and cannot be used without adaptation to the target system, so the security officers of that system have to assess it first.
The php.net manual describes password_hash() as creating a hash with a strong one-way algorithm. These points bear on the guidelines:
PASSWORD_DEFAULT currently uses bcrypt, and the manual says the constant is designed to change over time. The guidelines do not recommend bcrypt. Naming the algorithm in your code is a decision, so the project should make it explicitly.PASSWORD_ARGON2ID exists since PHP 7.3 and is available only if PHP was compiled with Argon2 support. password_algos() returns the algorithm identifiers your build registers, and the manual example lists 2y, argon2i and argon2id.memory_cost is in kibibytes, time_cost is the number of iterations and threads is the parallelism. The manual says the threads option is available only with libargon2, not with the libsodium implementation.password_hash() generates a random salt for each hash. An explicit salt option is deprecated and ignored as of PHP 8.0. The returned string holds algorithm, cost and salt, so password_verify() needs no separate columns. The manual says password_verify() is safe against timing attacks.PASSWORD_BCRYPT the password is truncated to a maximum of 72 bytes.Converted to PHP options, the 12 MiB row is memory_cost 12288 with time_cost 3, the 19 MiB row is 19456 with 2, and the 46 MiB row is 47104 with 1.
<?php
$options = [
'memory_cost' => 19456, // 19 MiB in KiB
'time_cost' => 2,
'threads' => 1,
];
if (!in_array('argon2id', password_algos(), true)) {
throw new RuntimeException('This PHP build has no Argon2id support.');
}
function check_login(string $plain, string $storedHash, array $options): bool
{
if (!password_verify($plain, $storedHash)) {
return false;
}
if (password_needs_rehash($storedHash, PASSWORD_ARGON2ID, $options)) {
$newHash = password_hash($plain, PASSWORD_ARGON2ID, $options);
// store $newHash on the user record
}
return true;
}Two gaps matter. The php.net options do not include a digest length or a salt length, so the 128 bit and 256 bit columns of Table 1 are not settings I can read off the manual, and the two 256 bit rows have no matching option. Whether the 128 bit rows are met is for a test and your adviser. The default values of the Argon2 options are available as the constants PASSWORD_ARGON2_DEFAULT_MEMORY_COST, PASSWORD_ARGON2_DEFAULT_TIME_COST and PASSWORD_ARGON2_DEFAULT_THREADS, and the project should print them on the target server and compare them with the table. The manual advises benchmarking on the real hardware and adjusting the parameters, which is also what the guidelines ask.
The login is the only moment the plain password is available. The manual’s password_needs_rehash() page shows the sequence: verify, ask whether the hash implements the algorithm and options you now want, and if not, hash again and update the record. The function returns true when the hash does not match the given algorithm and options.
A hash made by an older home-grown scheme, such as a bare digest of the password, is outside what password_hash() produces. It needs a separate check of the old scheme first, and only a successful check leads to the new hash. After that the old value disappears from the record. Users who never log in again keep their old hashes. Whether to expire or reset those accounts is a decision for the controller, because the guidelines say stored credentials should not be kept longer than needed.
The Garante adds a retention rule next to the technical one. Under the principle of storage limitation (article 5(1)(e) GDPR), passwords should be deleted promptly, also automatically, when they are no longer needed to verify the identity of users or to ensure security. It names two legitimate reasons to keep older values: a password history that stops users from reusing a password, and backups that restore the authentication system after an incident. Both carry risk, because technical progress can make a measure obsolete. The guidelines also say passwords go when the system or service ceases, or when the credentials are deactivated.
In a PHP project this becomes concrete decisions: how many previous hashes the history table holds, whether deleted accounts lose their hashes at once, and how long database backups with old hashes stay around. The application can do the first two. The backup period is an operations and policy question for the controller.
Here is what I would put in a Turin project that stores passwords, as work I can build and check:
password_verify and password_needs_rehash in one login function, with a test that proves an old hash is replaced after a successful login.argon2id from password_algos().The decision that the system is in scope, and that other measures are acceptable, belongs to the controller. I write down the technical facts so that decision has something to rest on.
I need access to the code and a staging server. How I work on PHP in general is on the PHP developer page.
If your Turin application stores passwords and you want to know where it stands against the guidelines, send the repository or the relevant files, the PHP version and your deadline through the contact form. The first written estimate for a password migration is free. Whether the guidelines apply to your processing, and which other measures you can justify, is for you and your adviser to decide.
Examples of my work.
surfuje.pl is a website for surfers and watersports enthusiasts, with clear content, simple publishing, and stable technical operation.
zamki-szkocji.com is a comprehensive information portal dedicated to the castles of Scotland, combining rich historical content, interactive maps, photo gall...
scalac.io is an international platform founded in 2014 to meet the challenges associated with big data management and business operations scaling, specializing in Scala, distributed systems, and cryptography solutions.
Describe your project by e-mail. I reply within 24 hours.
Describe your projectNeed to show the category hierarchy in your theme? Learn how to get the current category and its parent using get_the_category() and get_category_parents().
Need to get the URL of the first image or link in an article? Prefer DOMDocument over regex. Ready-made WordPress PHP for developers.
On 1 December 2026 Taylor Otwell shipped the Laravel Rust beta, and Laravel Go followed a day later. What the framework contains, what the 18x benchmark really measures, what happens to Laravel PHP and WordPress, and when a rewrite makes sense.
Custom WordPress engineering and architecture.
Scalable headless, ERP, and AI architecture for enterprise.
Stores, checkout flow, and sales logic.
Stability, updates, and post-launch support.
What the monthly care fee covers and what changes it.
Business process automation around WordPress and company systems.
Headless WordPress, Sanity, Strapi, and Contentful with Astro or Next.js.
Astro, MDX, edge delivery, and Core Web Vitals measured on real traffic.

How to start as a WordPress developer in 2026. Local environment, theme and plugin development, REST API and headless paths, security and Core Web Vitals. A practitioner playbook that does not waste your first month.

WordPress 7.0 with AI Client against Astro 7 with the Rust compiler and Vite 8. Speed, cost, SEO and security compared, plus the real bill for my own Astro 6 to 7 migration.

A detailed comparison table of EmDash CMS and WordPress across architecture, security, plugins, AI features, content model, hosting, and ecosystem maturity.