def strip_PKCS7_padding(s):
"""return s stripped of PKCS7 padding"""
if len(s)%16 or not s:
raise ValueError("String of len %d can't be PCKS7-padded" % len(s))
numpads = ord(s[-1])
if numpads > 16:
raise ValueError("String ending with %r can't be PCKS7-padded" % s[-1])
return s[:-numpads]
slowaes-0.1a1
Original issue reported on code.google.com by bugzilla...@yandex.ru on 8 Sep 2012 at 2:58
Original issue reported on code.google.com by
bugzilla...@yandex.ru
on 8 Sep 2012 at 2:58