def pad(octet_string, block_size=16):
    """ Pad a string to a multiple of block_size octets """
    pad_length = block_size - len(octet_string)
    return  octet_string + '\x80' + '\x00'*(pad_length-1)