PHP developer in Turin

WordPress for businesses in Turin, delivered remotely by one developer.

PHP developer

My place in the WordPress community

  • I have had a wordpress.org account since 2006.
  • I contributed to WordPress core for versions 7.0 and 7.1.
  • I maintain 30 plugins on wordpress.org.
  • I organise and speak at WordCamps.
  • I have attended every WordCamp Europe from 2017 to 2026.
  • Local WordPress meetup: WordPress Torino Meetup

My WordPress.org profile

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.

Mole Antonelliana and the Alps seen from Turin

The Mole Antonelliana above Turin, Alps in the background. Turin photo by Abbrey82, licensed CC BY-SA 4.0, via Wikimedia Commons.

#What do the Garante guidelines on passwords say?

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.

#When does it apply?

The Garante considers the guideline measures necessary in particular when one or more of three conditions is met:

  • the processing concerns the passwords of a significant number of users
  • it concerns users who can reach databases of particular relevance or size
  • it concerns specific types of users who systematically process special category data or data on criminal convictions with computer systems

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.

#Which algorithms do the guidelines recommend?

The annex is a technical document by the ACN, published on the Garante site, dated December 2023. Its conclusions:

  • a salt is mandatory for any password hashing algorithm, and custom solutions are advised against
  • encrypting passwords instead of hashing them is discouraged, mainly because of the key management it needs
  • PBKDF2 is acceptable only with the hash functions named in the referenced document, with as many iterations as possible
  • bcrypt is described as rather dated and is not recommended, given the progress made by the other algorithms
  • scrypt and Argon2id are the most robust and efficient and should take priority over any other choice

Table 1 of the annex sets the minimum parameters. For Argon2id it lists a salt of at least 128 bit and these combinations:

DigestIterations (c)Memory (m)Parallelism (p)
128 bit146 MiB1
128 bit219 MiB1
128 bit312 MiB1
128 bit49 MiB1
128 bit57 MiB1
256 bit12048 MiB4
256 bit364 MiB4

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.

#How does that map to password_hash?

The php.net manual describes password_hash() as creating a hash with a strong one-way algorithm. These points bear on the guidelines:

  • Default. 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.
  • Argon2id. 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.
  • Options. 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.
  • Salt. 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.
  • bcrypt limit. With PASSWORD_BCRYPT the password is truncated to a maximum of 72 bytes.
  • Column size. The manual advises a column that can grow beyond 60 bytes, and suggests 255 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.

#How do old hashes move to Argon2id?

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.

#How long may passwords be kept?

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.

#What a project covers

Here is what I would put in a Turin project that stores passwords, as work I can build and check:

  1. An explicit algorithm and options, chosen from the guideline table and benchmarked on the production server.
  2. password_verify and password_needs_rehash in one login function, with a test that proves an old hash is replaced after a successful login.
  3. A hash column that can grow, and no custom hashing, no static salt and no encrypted storage.
  4. A deletion path for credentials of closed accounts, and a short note of the retention periods for the controller’s records.
  5. A pre-release check that the build reports 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.

#How does a project run?

  1. You send the application address or repository, the PHP version, how passwords are stored today, and your deadline.
  2. I write down the scope and my assumptions, with questions on legacy hashes, backups and the PHP build.
  3. I build on a staging copy in a private Git repository, and you test logins and resets with test accounts.
  4. Nothing goes live until you accept it in writing. At handover you keep the repository and the tests.

I need access to the code and a staging server. How I work on PHP in general is on the PHP developer page.

#Send me your login code

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.

Need this service: PHP developer in Turin?

Describe your project by e-mail. I reply within 24 hours.

Describe your project

Latest PHP developer articles

Dec 2, 2026

Laravel Rust: what does it mean for PHP apps?

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.

Explore other WordPress services and knowledge base