package com.yfd.platform.utils;

import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
import org.jasypt.util.text.BasicTextEncryptor;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class EncryptConfigUtil {

    public static void main(String[] args) {

//        String salt = "rca20230101";
//        String password = "123456";
//
//        BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
//        //加密所需的salt
//        textEncryptor.setPassword(salt);
//        //要加密的数据（数据库的用户名或密码）
//        String encrypt = textEncryptor.encrypt(password);
//        System.out.println("password:"+encrypt);


        BCryptPasswordEncoder passwordEncoder=new BCryptPasswordEncoder();
        String cryptPassword=passwordEncoder.encode("dl_2023");//设置缺省密码

    }

}