Einzelnen Beitrag anzeigen

Kas Ob.

Registriert seit: 3. Sep 2023
380 Beiträge
 
#5

AW: Kleines Weihnachtsgeschenk von der DEC

  Alt 28. Dez 2024, 15:07
To your second proposal. What is the workflow? Do you really have a chiffre where you dont know, if PKCS#7 padding was added or not?
No, i don't have specific logic where we are in doubt if there is a PKCS7 padding or not, this should not be the case.

The problem is from my point of view, if we would offer such check method, we run decrypt two times, one in this check and one after it for getting the result. Than an option for a facultative padding would be better but result in a more complex interface.
My suggestion is small cosmetic, the refactor i suggested is based on the fact PKCS7 padding is used in few other places not just symmetric encryption or in PKCS7 CMS itself, this padding is the most used in asymmetric encryption and signing, also it is de facto the most used data padding scheme in general, so extracting the check for validity will be helpful, instead of repeating that loop, we can have a tidy small check for validity and correctness, .... well naming could be better like HasValidPKCS7Padding (i missed typed it as HasValidPKCS7).
Kas
  Mit Zitat antworten Zitat