diff --git a/apps/common/utils/crypto.py b/apps/common/utils/crypto.py index 994c0f087..1407c7d7d 100644 --- a/apps/common/utils/crypto.py +++ b/apps/common/utils/crypto.py @@ -83,7 +83,7 @@ class PiicoSM4EcbCrypto(BaseCrypto): def _decrypt(self, data: bytes) -> bytes: bs = self.cipher.decrypt(data) - return bs[:bs.index(0)] + return bs.rstrip(b'\0') class AESCrypto: