使用Fiddler 中的 TextWizard 工具进行加密, 得到两个结果:
一个是: 十六进制的字符串:
另外一个字符串: zLOMFoW0QQaRTrCowt04LmPFRag=
这个字符串是什么? 怎么得来的? 代码能获取么?
回答
十六进制的字符串 是经过 Base64 加密后来的
package com.yushixin.utils;
import java.util.Base64;
public class Main {
public static void main(String[] args) {
String s = "zLOMFoW0QQaRTrCowt04LmPFRag=";
Base64.Decoder decoder = Base64.getDecoder();
byte[] decode = decoder.decode(s);
StringBuilder sb = new StringBuilder();
for (byte b : decode) {
String substring = Integer.toHexString((b & 0xFF) | 0x100).toUpperCase().substring(1, 3);
sb.append(substring).append("-");
}
// CC-B3-8C-16-85-B4-41-06-91-4E-B0-A8-C2-DD-38-2E-63-C5-45-A8-
System.out.println(sb);
}
}