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

support decrypt data by aes #14328

Closed
lmatz opened this issue Jan 3, 2024 · 2 comments
Closed

support decrypt data by aes #14328

lmatz opened this issue Jan 3, 2024 · 2 comments
Assignees
Milestone

Comments

@lmatz
Copy link
Contributor

lmatz commented Jan 3, 2024

Is your feature request related to a problem? Please describe.

PG has such implementations:
https://www.postgresql.org/docs/current/pgcrypto.html#PGCRYPTO-RAW-ENC-FUNCS

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

Example from the user:

val aes = new AESDecrypySerialize("keyyyyyyyyyyy", "AES/ECB/PKCS5Padding")
val content = aes.decrypt(json.getString("CONTENT").toString)
@github-actions github-actions bot added this to the release-1.6 milestone Jan 3, 2024
@lmatz lmatz modified the milestones: release-1.6, release-1.7 Jan 9, 2024
@fuyufjh fuyufjh modified the milestones: release-1.6, release-1.7 Jan 9, 2024
@lmatz
Copy link
Contributor Author

lmatz commented Jan 23, 2024

Only one mode is needed right now:

AES/ECB/PKCS5Padding

https://docs.oracle.com/javase%2F7%2Fdocs%2Fapi%2F%2F/javax/crypto/Cipher.html
SCR-20240123-mkn

https://arc.net/l/quote/yhhfaiib:
PKCS5Padding schema is actually very simple. It follows the following rules:
The number of bytes to be padded equals to “8 - numberOfBytes(clearText) mod 8”. So 1 to 8 bytes will be padded to the clear text data depending on the length of the clear text data.
All padded bytes have the same value - the number of bytes padded.

SCR-20240123-mkq

sfackler/rust-openssl#40
SCR-20240123-mld

can use rust's open-ssl: https://docs.rs/openssl/latest/openssl/aes/index.html

@neverchanje
Copy link
Contributor

#14717

I think this pr can resolve this issue.

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

No branches or pull requests

4 participants