Class BSDMD5Crypt


  • public final class BSDMD5Crypt
    extends Object
    BSD MD5 Crypt algorithm, ported from C.
    Author:
    ludo
    • Constructor Detail

      • BSDMD5Crypt

        public BSDMD5Crypt()
    • Method Detail

      • crypt

        public static String crypt​(ByteSequence password,
                                   String salt)
                            throws NoSuchAlgorithmException
        Encode the supplied password in BSD MD5 crypt form, using provided salt.
        Parameters:
        password - 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.
        Throws:
        NoSuchAlgorithmException - If the MD5 algorithm is not supported.
      • 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