def rpad_string(s, block_size=16, pad_char='\x00'):
    """Return right-padded version of string with length as multiple of block size."""
    mod = len(s) % block_size
    return s if not mod else s + (block_size - mod) * pad_char
