Class BSDMD5Crypt

java.lang.Object
org.opends.server.util.BSDMD5Crypt

public final class BSDMD5Crypt extends Object
BSD MD5 Crypt algorithm, ported from C.
  • Method Details

    • crypt

      public static String crypt(byte[] plaintextBytes)
      Encode the supplied password in BSD MD5 crypt form, using a random salt.
      Parameters:
      plaintextBytes - A password to encode.
      Returns:
      An encrypted string.
    • crypt

      public static String crypt(byte[] plaintextBytes, String salt)
      Encode the supplied password in BSD MD5 crypt form, using provided salt.
      Parameters:
      plaintextBytes - A password to encode.
      salt - A salt string of any size, of which only the first 8 bytes will be considered.
      Returns:
      An encrypted string.
    • getMagicString

      public static String getMagicString()
      Getter to the BSD MD5 magic string.
      Returns:
      the magic string for this crypt algorithm
    • main

      public static void main(String[] argv)
      Main test method.
      Parameters:
      argv - The array of test arguments