Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Padding mode used in response and docs is difference. #5

Open
s911415 opened this issue Mar 21, 2019 · 2 comments
Open

Padding mode used in response and docs is difference. #5

s911415 opened this issue Mar 21, 2019 · 2 comments

Comments

@s911415
Copy link

s911415 commented Mar 21, 2019

I use java sample provided in this repo, there are padding bytes in decrypted data.

Attachment is the screenshot that data i got.
img01

btw. crypto-js seems to used Pkcs7 as default.
https://cryptojs.gitbook.io/docs/#block-modes-and-padding

@naokij
Copy link

naokij commented Apr 12, 2022

是的,我遇到了一样的问题,尝试用zero pad的方式去unpadd,结果结尾给我了8个8或者4个4.

@jiayun
Copy link

jiayun commented Jun 29, 2023

@s911415 @naokij

Java 使用 Cipher.getInstance("AES/CBC/PKCS5Padding"); 就可以解決了

Java 的 PKCS5Padding 有實作 PKCS7 的規格

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants