Java加密解密原创
# 1.Base64解密
# 1.1. 依赖
<!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
</dependency>
1
2
3
4
5
6
2
3
4
5
6
# 1.2. 解密
Base64 base64 = new Base64();
String sdkVersion = "NC4zOTEuMTI2Nw==";
System.out.println(new String(base64.decode(sdkVersion), "UTF-8"));
1
2
3
2
3
# 2. MD5加密
# 2.1. 依赖
<!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
</dependency>
1
2
3
4
5
6
2
3
4
5
6
# 2.2. 加密
String device = "31754c4b-e1c5-4cf3-a2b2-c3fa26350aed";
String md5 = DigestUtils.md5Hex(device);
System.out.println("原文:" + device);
System.out.println("MD5 :" + md5);
1
2
3
4
5
2
3
4
5
- 02
- 2025-03-28拍婚纱照 原创04-02
- 03
- 2024-04-05的晚上 原创04-01