• Jasypt加解密


    package com.xingyi.bos.utils;
    
    import com.xingyi.bos.ZjBosApplication;
    import org.jasypt.encryption.StringEncryptor;
    import org.junit.Test;
    import org.junit.runner.RunWith;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.boot.test.context.SpringBootTest;
    import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
    import org.springframework.test.context.junit4.SpringRunner;
    
    /**
     * Created by Administrator on 2021/9/2.
     */
    @RunWith(SpringRunner.class)
    @SpringBootTest(classes = {ZjBosApplication.class})
    public class JasyptApplicationTests {
        @Autowired
        private StringEncryptor stringEncryptor;
    
        @Test
        public void contextLoads() {
            //加密方法
    //        System.out.println(stringEncryptor.encrypt("123456"));
    //        System.out.println(stringEncryptor.encrypt("123456"));
    
            //解密方法 ENC(c/Y2PZMYWlFjx7IbNCt8rhsuwLYVWhMI)中的c/Y2PZMYWlFjx7IbNCt8rhsuwLYVWhMI
            System.out.println(stringEncryptor.decrypt("H+u9Bhik38B+UdPZDMLz/BXksIb3KplomVWN/JvQOZI="));
        }
    
        /*
        4n8hBnSULbLF5FJrC/kMxA==
        MWzRCtyFK0AXpH6g99GOTA==
        RXy31IPONj1nwV01P0+TaA==
        a6EH3950mQYTHtWAop6wDw==
         */
    }
  • 相关阅读:
    习题解答chapter-01
    Java-chapter-01 菜鸟初见Java
    ijkdemo
    1027
    avformat_seek_file
    pla
    android1010横屏等
    文件浏览对话框
    智能指针处理---bo
    Js为Dom元素绑定事件须知
  • 原文地址:https://www.cnblogs.com/super-chao/p/15241942.html
Copyright © 2020-2023  润新知