ENC加密

 

ENC加密
username: ${MYSQL_USER:ENC(YM6DAVWjLDr6J6bWqOpcLaFwProvLOVT)}

加密
http://192.168.xxx:xx/xx/enc/encrypt?input=xmh  YM6DAVWjLDr6J6bWqOpcLaFwProvLOVT
解密 
http://192.168.144.xxx:xxx/xx/enc/decrypt?input=YM6DAVWjLDr6J6bWqOpcLaFwProvLOVT

<artifactId>jasypt-spring-boot-starter</artifactId>
<groupId>com.github.ulisesbocchio</groupId>
<version>3.0.4</version>

@Autowired
private StringEncryptor stringEncryptor;

@Operation(summary = "加密", description = "ENC()为固定格式")
@GetMapping("/encrypt")
public String encrypt(String input){
return stringEncryptor.encrypt(input);
}

@Operation(summary = "解密")
@GetMapping("/decrypt")
public String decrypt(String input){
return stringEncryptor.decrypt(input);
}

 

posted @ 2023-08-10 15:25  XUMT111  阅读(264)  评论(0编辑  收藏  举报