All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.lazyegg.core.security.ENCUtil Maven / Gradle / Ivy

The newest version!
package io.lazyegg.core.security;

import org.jasypt.util.text.BasicTextEncryptor;

public class ENCUtil {

    /**
     * 加密
     *
     * @param input
     * @param password
     * @return
     */
    public static String encrypt(String input, String password) {
        BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
        textEncryptor.setPassword(password);
        return textEncryptor.encrypt(input);
    }

    /**
     * 解密
     *
     * @param input
     * @param password
     * @return
     */
    public static String decrypt(String input, String password) {
        BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
        textEncryptor.setPassword(password);
        return textEncryptor.decrypt(input);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy