Class BruteForcePasswordGenerator

    • Field Detail

      • m_MaxLength

        protected int m_MaxLength
        the maximum length for passwords to test.
      • m_Counter

        protected int[] m_Counter
        counter for generating the passwords.
      • m_Chars

        protected char[] m_Chars
        the characters to use in the attack.
      • m_Max

        protected int m_Max
        the maximum number of characters.
      • m_Password

        protected char[] m_Password
        the buffer for the password.
      • m_NumChars

        protected int m_NumChars
        the current number of characters in the password.
      • m_Next

        protected String m_Next
        the next password.
      • m_NextGenerated

        protected boolean m_NextGenerated
        whether the next password has already been generated.
    • Constructor Detail

      • BruteForcePasswordGenerator

        public BruteForcePasswordGenerator​(String chars,
                                           int maxLength)
        Initializes the generator.
        Parameters:
        chars - the characters to use for each position
        maxLength - the maximum length of the password
      • BruteForcePasswordGenerator

        public BruteForcePasswordGenerator​(String chars,
                                           int maxLength,
                                           String start)
        Initializes the generator.
        Parameters:
        chars - the characters to use for each position
        maxLength - the maximum length of the password
        start - the starting password, use null to start from scratch
    • Method Detail

      • doNext

        protected String doNext()
        Generates the next password.
        Returns:
        the next password, null if no more available