def check_format(input_data, data_type):
    """
    input_data will be checked by the its own data type.
    :param input_data: str, the given key or ciphered string.
    :param data_type: str, indicate what kind of data type to check format.
    :return: str, input data all checked in legal format.
    """
    # extension: check secret number isdigit
    if data_type == "int":
        if not input_data.isdigit():
            input_data = check_format(input("Secret number should be a number, enter again: "), "int")
    else:
        # all upper
        input_data = input_data.upper()
    return input_data