def pad(message='', block_size=16):
    """ returns a message padded to the appropriate block size """

    pad_size = block_size - (len(message) % block_size)
    padding = chr(pad_size) * pad_size
    return message + padding