001    package users;
002    
003    import java.io.Serializable;
004    
005    /**
006     * Strategy to be used when garbling passwords. A concrete implementation of this interface can be found in
007     * {@link User#DEFAULT_PASSWORD_GARBLER}.
008     *
009     * @see User#setGlobalPassWDGarbler
010     * @see User#garblePassWD
011     *
012     * @author Steffen Zschaler
013     * @version 2.0 05/05/1999
014     * @since v2.0
015     */
016    public interface PassWDGarbler extends Serializable {
017    
018        /**
019         * Garble the given password and return the result.
020         *
021         * <p>You can implement any garbling algorithm as long as the follwoing conditions
022         * hold:
023         * <ol>
024         *   <li>It takes a char[] and returns a char[].</li>
025         *   <li>Different passwords give different results.</li>
026         *   <li>The same password gives the same result in subsequent calls.</li>
027         * </ol>
028         *
029         * @param sPassWD the password to be garbled.
030         *
031         * @return the garbled password.
032         *
033         * @see User#garblePassWD
034         * @see User#isPassWd
035         *
036         * @override Always
037         */
038        public char[] garblePassWD(char[] sPassWD);
039    }