Class GlibcCryptPasswordEncoder

  • All Implemented Interfaces:
    org.springframework.security.crypto.password.PasswordEncoder

    public class GlibcCryptPasswordEncoder
    extends java.lang.Object
    implements org.springframework.security.crypto.password.PasswordEncoder
    Since:
    5.3.10
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String encode​(java.lang.CharSequence password)  
      boolean matches​(java.lang.CharSequence rawPassword, java.lang.String encodedPassword)
      Special note on DES UnixCrypt: In DES UnixCrypt, so first two characters of the encoded password are the salt.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.springframework.security.crypto.password.PasswordEncoder

        upgradeEncoding
    • Constructor Detail

      • GlibcCryptPasswordEncoder

        public GlibcCryptPasswordEncoder()
    • Method Detail

      • encode

        public java.lang.String encode​(java.lang.CharSequence password)
        Specified by:
        encode in interface org.springframework.security.crypto.password.PasswordEncoder
      • matches

        public boolean matches​(java.lang.CharSequence rawPassword,
                               java.lang.String encodedPassword)
        Special note on DES UnixCrypt: In DES UnixCrypt, so first two characters of the encoded password are the salt.

        When you change your password, the /bin/passwd program selects a salt based on the time of day. The salt is converted into a two-character string and is stored in the /etc/passwd file along with the encrypted "password."[10] In this manner, when you type your password at login time, the same salt is used again. UNIX stores the salt as the first two characters of the encrypted password.

        Specified by:
        matches in interface org.springframework.security.crypto.password.PasswordEncoder
        Parameters:
        rawPassword - the raw password as it was provided
        encodedPassword - the encoded password.
        Returns:
        true/false