MD5PasswordEncoder.java 1006 Bytes
package weaver.authentication.handler.encoder;

import org.jasig.cas.authentication.handler.PasswordEncoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import weaver.loginsso.AES;

import java.util.Map;

/**
 * Created by crazyDream on 2018/9/17.
 */
public class MD5PasswordEncoder implements PasswordEncoder {
    @Override
    public String encode(String password) {
        return null;
    }

    @Override
    public String encode(String username, String password) {
        /*try {
            String yjcust = AES.decrypt(password, "yjcust");
            if (yjcust != null && yjcust.indexOf("-f-g-") > 0) {
                password=yjcust.substring(0,yjcust.indexOf("-f-g-"));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }*/

        MD5 md5 = new MD5();
        return md5.getMD5ofStr(password);
    }

    @Override
    public String encode(String username, String password, Map<String, Object> otherParams) {
        return null;
    }
}