提交 32f44c5d authored 作者:  狄熙卜's avatar 狄熙卜

解密逻辑优化

狄熙卜
上级 3978e74d
...@@ -163,7 +163,7 @@ public class GmSm4Util { ...@@ -163,7 +163,7 @@ public class GmSm4Util {
byte[] keyData = ByteUtils.fromHexString(hexKey); byte[] keyData = ByteUtils.fromHexString(hexKey);
byte[] cipherData; byte[] cipherData;
byte[] srcData; byte[] srcData;
String result = ""; String result = cipherText;
if (StringUtils.startsWithIgnoreCase(cipherText, salt)) { if (StringUtils.startsWithIgnoreCase(cipherText, salt)) {
if (StringUtils.endsWith(cipherText, "等")) { if (StringUtils.endsWith(cipherText, "等")) {
String realCipherText = StringUtils.removeEnd(StringUtils.removeStartIgnoreCase(cipherText, salt), "等"); String realCipherText = StringUtils.removeEnd(StringUtils.removeStartIgnoreCase(cipherText, salt), "等");
...@@ -201,7 +201,7 @@ public class GmSm4Util { ...@@ -201,7 +201,7 @@ public class GmSm4Util {
byte[] keyData = ByteUtils.fromHexString("645B0A010D939BD614A620BCAF645470"); byte[] keyData = ByteUtils.fromHexString("645B0A010D939BD614A620BCAF645470");
byte[] cipherData; byte[] cipherData;
byte[] srcData; byte[] srcData;
String result = ""; String result = cipherText;
if (StringUtils.startsWithIgnoreCase(cipherText, SaltsEnum.GM_SM4_SALTS.getSalt())) { if (StringUtils.startsWithIgnoreCase(cipherText, SaltsEnum.GM_SM4_SALTS.getSalt())) {
if (StringUtils.endsWith(cipherText, "等")) { if (StringUtils.endsWith(cipherText, "等")) {
String realCipherText = StringUtils.removeEnd(StringUtils.removeStartIgnoreCase(cipherText, SaltsEnum.GM_SM4_SALTS.getSalt()), "等"); String realCipherText = StringUtils.removeEnd(StringUtils.removeStartIgnoreCase(cipherText, SaltsEnum.GM_SM4_SALTS.getSalt()), "等");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论