package users;

import java.io.Serializable;

/**
  * Strategy to be used when garbling passwords. A concrete implementation of this interface can be found in
  * {@link User#DEFAULT_PASSWORD_GARBLER}.
  *
  * @see User#setGlobalPassWDGarbler
  * @see User#garblePassWD
  *
  * @author Steffen Zschaler
  * @version 2.0 05/05/1999
  * @since v2.0
  */
public interface PassWDGarbler extends Serializable {

  /**
    * Garble the given password and return the result.
    *
    * <p>You can implement any garbling algorithm as long as the follwoing conditions
    * hold:
    * <ol>
    *   <li>It takes a string and returns a string.</li>
    *   <li>Different passwords give different results.</li>
    *   <li>The same password gives the same result in subsequent calls.</li>
    * </ol>
    *
    * @param sPassWD the password to be garbled.
    *
    * @return the garbled password.
    *
    * @see User#garblePassWD
    * @see User#isPassWd
    *
    * @override Always
    */
  public String garblePassWD (String sPassWD);
}