Interface ISalmonPbkdfProvider

All Known Implementing Classes:
SalmonDefaultPbkdfProvider

public interface ISalmonPbkdfProvider
Provides key derivation based on text passwords.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated.
    static final String
    Java Cipher key for SHA256.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    getKey(String password, byte[] salt, int iterations, int outputBytes, PbkdfAlgo pbkdfAlgo)
    Get a key derived from a text password.
    static String
    Get the PBKDF java cipher algorigthm string.
  • Field Details

    • PBKDF_SHA256

      static final String PBKDF_SHA256
      Java Cipher key for SHA256. See javax.crypto.SecretKeyFactory.
      See Also:
    • PBKDF_SHA1

      @Deprecated static final String PBKDF_SHA1
      Deprecated.
      Java Cipher key for SHA1. See javax.crypto.SecretKeyFactory. WARNING! SHA1 is considered insecure! Use PBKDF_SHA256 instead.
      See Also:
  • Method Details

    • getPbkdfAlgoString

      static String getPbkdfAlgoString(PbkdfAlgo pbkdfAlgo)
      Get the PBKDF java cipher algorigthm string.
      Parameters:
      pbkdfAlgo - The PBKDF algorithm to use
      Returns:
      The java cipher algorithm string. See javax.crypto.SecretKeyFactory.
    • getKey

      byte[] getKey(String password, byte[] salt, int iterations, int outputBytes, PbkdfAlgo pbkdfAlgo)
      Get a key derived from a text password.
      Parameters:
      password - The text password.
      salt - The salt needs to be at least 24 bytes.
      iterations - Iterations to use. Make sure you use a high number according to your hardware specs.
      outputBytes - The length of the output key.
      pbkdfAlgo - The PBKDF algorithm to use
      Returns:
      The key.
      Throws:
      SalmonSecurityException - Thrown if there is a security exception