You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "ddmg-250 (via GitHub)" <gi...@apache.org> on 2025/08/08 06:27:40 UTC
[I] help request: SM4-CBC encryption in resty.openssl.cipher produces incompatible output with Java due to padding discrepancy [apisix]
ddmg-250 opened a new issue, #12504:
URL: https://github.com/apache/apisix/issues/12504
### Description
I encrypt data using the resty.opensl.cipher class in sm4-cbc mode, but after encryption, it still cannot be decrypted using JAVA. The same string is encrypted using the opensll command, which is consistent with Java, but different from Lua scripts, using the same key and IV. Has anyone encountered the same problem. My API version for the environment is 3.11.0 and OpenSSL version is 3.2.0. But it has been resolved. The problem lies in the inconsistent data filling method. Some people say that the default filling method for FFI is pkcs7, which is compatible with Java's pkcs5. Testing found that they still cannot encrypt and decrypt each other. Later, manual data filling using Lua scripts was used to solve the incompatibility problem; Does anyone know what the default filling method for this class is
### Environment
- APISIX version (run `apisix version`):
- Operating system (run `uname -a`):
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
- etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run `luarocks --version`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: SM4-CBC encryption in resty.openssl.cipher produces incompatible output with Java due to padding discrepancy [apisix]
Posted by "SkyeYoung (via GitHub)" <gi...@apache.org>.
SkyeYoung commented on issue #12504:
URL: https://github.com/apache/apisix/issues/12504#issuecomment-3173669445
The current information seems to indicate that you've already solved this problem, but you want to know the default method for data filling?
I think this should be in the discussion, rather than the issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: SM4-CBC encryption in resty.openssl.cipher produces incompatible output with Java due to padding discrepancy [apisix]
Posted by "SkyeYoung (via GitHub)" <gi...@apache.org>.
SkyeYoung closed issue #12504: help request: SM4-CBC encryption in resty.openssl.cipher produces incompatible output with Java due to padding discrepancy
URL: https://github.com/apache/apisix/issues/12504
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org