Class BLAKE3Pseudonymizer

java.lang.Object
org.trustdeck.algorithms.Pseudonymizer
org.trustdeck.algorithms.BLAKE3Pseudonymizer

public class BLAKE3Pseudonymizer extends Pseudonymizer
This class provides a pseudonymization by assigning blake3-hash-values as pseudonyms.
Author:
Armin Müller
  • Constructor Details

    • BLAKE3Pseudonymizer

      public BLAKE3Pseudonymizer()
      Basic constructor. Padding is turned off. (The pseudonym value length is automatically set to the default, as well as the padding character.)
    • BLAKE3Pseudonymizer

      public BLAKE3Pseudonymizer(String domainName)
      Basic constructor. Padding is turned off. (The pseudonym value length is automatically set to the default, as well as the padding character.)
      Parameters:
      domainName - the name of the domain to which the record belongs to
    • BLAKE3Pseudonymizer

      public BLAKE3Pseudonymizer(boolean paddingWanted, int pseudonymValueLength, char paddingChar, String domainName)
      A constructor that allows to set whether or not the created pseudonyms should be padded as well as the desired pseudonym value length and the character used for padding.
      Parameters:
      paddingWanted - whether or not the pseudonyms should be padded to a certain length
      pseudonymValueLength - the desired length of the pseudonym value
      paddingChar - the character that should be used
      domainName - the name of the domain to which the record belongs to
    • BLAKE3Pseudonymizer

      public BLAKE3Pseudonymizer(boolean paddingWanted, Domain domain)
      Basic constructor. All necessary variables are directly retrieved from the domain object.
      Parameters:
      paddingWanted - whether or not the pseudonyms should be padded to a certain length
      domain - the domain object
    • BLAKE3Pseudonymizer

      public BLAKE3Pseudonymizer(boolean paddingWanted, Algorithm algorithm)
      Basic constructor. All necessary variables are directly retrieved from the algorithm object.
      Parameters:
      paddingWanted - whether or not the pseudonyms should be padded to a certain length
      algorithm - the algorithm object
  • Method Details

    • pseudonymize

      public String pseudonymize(String identifier, String domainPrefix)
      Creates a blake3 hash pseudonym from the given identifier.
      Specified by:
      pseudonymize in class Pseudonymizer
      Parameters:
      identifier - the value to be pseudonymized
      domainPrefix - the prefix for the domain
      Returns:
      a pseudonym in the form of domainPrefix-pseudonymValue (e.g. TST-a1cd75fe29c449248cabfae)