diff --git a/src/main/java/com/dispose/common/ProtoCryptoType.java b/src/main/java/com/dispose/common/ProtoCryptoType.java index ad23555c..2346f545 100644 --- a/src/main/java/com/dispose/common/ProtoCryptoType.java +++ b/src/main/java/com/dispose/common/ProtoCryptoType.java @@ -17,7 +17,7 @@ public enum ProtoCryptoType { /** * The Crypto aes 256. */ - CRYPTO_AES256(2, "AES256加密"), + CRYPTO_AES128(2, "AES128加密"), /** * The Crypto des. */ diff --git a/src/main/java/com/dispose/service/impl/ProtocolSecurityServiceImpl.java b/src/main/java/com/dispose/service/impl/ProtocolSecurityServiceImpl.java index 93e2ec41..4082cbc5 100644 --- a/src/main/java/com/dispose/service/impl/ProtocolSecurityServiceImpl.java +++ b/src/main/java/com/dispose/service/impl/ProtocolSecurityServiceImpl.java @@ -70,7 +70,7 @@ public class ProtocolSecurityServiceImpl implements ProtocolSecurityService { // 加密类型为base64直接返回处理结果 if (proReq.getCryptoType() == ProtoCryptoType.CRYPTO_BASE64.getCode()) { decryptContent = base64Decode; - } else if (proReq.getCryptoType() == ProtoCryptoType.CRYPTO_AES256.getCode()) { + } else if (proReq.getCryptoType() == ProtoCryptoType.CRYPTO_AES128.getCode()) { try { decryptContent = CryptoHelper.aes128Decryption(base64Decode, SecurityConfigValue.AES_KEY); } catch (Exception e) { @@ -122,7 +122,7 @@ public class ProtocolSecurityServiceImpl implements ProtocolSecurityService { String cipherText; if (cryptoType == ProtoCryptoType.CRYPTO_BASE64.getCode()) { cipherText = CryptoHelper.base64Encryption(plainText.getBytes(StandardCharsets.UTF_8)); - } else if (cryptoType == ProtoCryptoType.CRYPTO_AES256.getCode()) { + } else if (cryptoType == ProtoCryptoType.CRYPTO_AES128.getCode()) { try { byte[] encode = CryptoHelper.aes128Encryption(plainText.getBytes(StandardCharsets.UTF_8), SecurityConfigValue.AES_KEY); diff --git a/src/test/java/com/dispose/test/testcase/dev/v200/CodeCoverage.java b/src/test/java/com/dispose/test/testcase/dev/v200/CodeCoverage.java index fccdf6ab..f477da11 100644 --- a/src/test/java/com/dispose/test/testcase/dev/v200/CodeCoverage.java +++ b/src/test/java/com/dispose/test/testcase/dev/v200/CodeCoverage.java @@ -57,7 +57,7 @@ public class CodeCoverage { .rspCode(ErrorCode.ERR_PARAMEXCEPTION) .autoLogin(true) .verifyCallback((VerifyProtoRespCallback) CodeCoverage::verifyJsonExceptionResp) - .prepareCallback(c -> SecurityConfigValue.SECURITY_PROTOCOL_TYPE = ProtoCryptoType.CRYPTO_AES256.getCode()) + .prepareCallback(c -> SecurityConfigValue.SECURITY_PROTOCOL_TYPE = ProtoCryptoType.CRYPTO_AES128.getCode()) .build(), };