Good day.
One problem appeared here, rewrite the backend of one site in PHP (now written in Java). The fact is that user authorization (or rather password hash) is now calculated using the method
passwordEncoder.encode (password);
in java. The stored hash is stored in the database, has a length of 80 characters. For example, for the password “12345”, the hash is “d0cf091711a1c35d5fac40ad8c522223365c7a7f286aa56d7ab80a11adaf7cfe2d1a9b91a5680080”.

Maybe someone knows, is there a similar hash function in PHP? I would be very grateful :)
PS Judging by the description of the method, Java hashes the pass through SHA-256, but if you apply it in PHP, then the output is a string of just 64 characters.
PPS Springframework is used for this method.

import org.springframework.security.crypto.password.StandardPasswordEncoder; public class NewClass { private static StandardPasswordEncoder passwordEncoder = new StandardPasswordEncoder(); public static void main(String[] args) { String password = "12345"; String hash = passwordEncoder.encode(password); System.out.println(hash); } } 
  • one
    A standard {@code PasswordEncoder} implementation that uses SHA-256 hashing with 1024 iterations and a random 8-byte random salt value. - etki
  • PHP version is what? - rjhdby
  • need to write in PHP 7 - Hicks

0