Skip to main content
Hafsh.2
Associate II
December 18, 2021
Question

Hello How can I use padding PKCS7 in the AES library?

  • December 18, 2021
  • 1 reply
  • 1117 views

..

    This topic has been closed for replies.

    1 reply

    Bubbles
    ST Employee
    December 21, 2022

    Hi @Community member​,

    sorry but this is a strange question. PKCS is all about public key cryptography, while the AES is a symmetric cipher. You can add the padding manually if you wish, and then use the AES cryptography primitive to encrypt the message. There is no high level API to do that, because it's not a common use case.

    BR,

    J

    To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
    Tesla DeLorean
    Guru
    December 21, 2022

    You'd need to pad to the inherent line width, 16 bytes for AES-128, due to how the cipher works.

    CTR mode works differently in that it doesn't directly act on the data, but generates a pattern.​

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..