def pad_pkcs5(data, block_size):
    """
    Returns the data padded using PKCS5.
    For a block size B and data with N bytes in the last block, PKCS5
    pads the data with B-N bytes of the value B-N.

    :param data: Data to be padded.
    :type data: :class:`str`

    :param block_size: Size of the block.
    :type block_size: :class:`int`

    :return: :class:`str` -- PKCS5 padded string.
    """
    pad = block_size - len(data) % block_size
    return data + pad * chr(pad)