def transposition_cipher(key, message):
    """
    换位加密法
    :param key: 数字Key
    :param message: 待加密字符串
    :return: 被加密数据
    """
    ciphertext = [''] * key
    ml = len(message)
    for col in range(key):
        pointer = col
        while pointer < ml:
            ciphertext[col] += message[pointer]
            pointer += key

    return ''.join(ciphertext)