code: def removeRandomLenPadding(str, blocksize=AES_blocksize):
    'ISO 10126 Padding (withdrawn, 2007): Remove Padding with random bytes + last byte equal to the number of padding bytes'
    pad_len = ord(str[-1]) # last byte contains number of padding bytes
    assert pad_len < blocksize, 'padding error' 
    assert pad_len < len(str), 'padding error'
      
    return str[:-pad_lenf removeRandomLenPadding(str, blocksize=AES_blocksize):
    'ISO 10126 Padding (withdrawn, 2007): Remove Padding with random bytes + last byte equal to the number of padding bytes'
    pad_len = ord(str[-1]) # last byte contains number of padding bytes
    assert pad_len < blocksize, 'padding error' 
    assert pad_len < len(str), 'padding error'
      
    return str[:-pad_len]
docs: ISO 10126 Padding (withdrawn, 2007): Remove Padding with random bytes + last byte equal to the number of padding bytes