Let's say you have an encryption algorithm that uses PKCS5 padding. You input 'secret message', which is 14 characters long, but for some reason or another the algorithm needs it to be 16 characters long. So you add on two bytes that are equal to 2 at the end.
Then when you decrypt it, you just look at the last byte and take that many off for the end result. But how would you be able to tell if there was no padding in the first place? I'm just a noob so be nice please. Thanks in advance!
01
is the padding of PKCS#7 (PKCS#7 > PKCS#5) or not? - Keep it aside, you get another message, decrypt it, and check, it fits more into PKCS#7, then your belief increased. $\endgroup$