Interface SaltedDigest

  • All Known Implementing Classes:
    SaltedDigestSha1

    public interface SaltedDigest
    Provides methods required to create a salted hash of a given secret. Different implementations may provide stronger or weaker algorithms as well as better or poorer performance.
    Author:
    Matthias Herlitzius
    • Method Detail

      • getDigest

        String getDigest​(String secret,
                         String salt)
        Returns a salted hash of the submitted secret.
        Parameters:
        secret - The cleartext secret.
        salt - The salt which should have been generated by the getSalt() method of the respective implementation.
        Returns:
        The salted hash (digest).
      • getSalt

        String getSalt()
        Generates a random salt. Can be used together with the getDigest(String, String) method of the respective implementation.
        Returns:
        the random salt