ctfsolver.src.position_cipher_functions ======================================= .. py:module:: ctfsolver.src.position_cipher_functions Classes ------- .. autoapisummary:: ctfsolver.src.position_cipher_functions.PositionCipher Module Contents --------------- .. py:class:: PositionCipher .. py:method:: load_lyrics() .. py:method:: dictionary_analysis(lyrics) .. py:method:: print_dictionary(d) .. py:method:: lyric_transpose(lyrics, offset, wrap=True) .. py:method:: lyric_transformation(lyrics) .. py:method:: lyrics_all() Description: This function generates all possible combinations of lyrics transformations based on the provided replace_combos and control_combos. It uses itertools.product to create combinations of the specified number of transformations, allowing for flexible lyric manipulation. :returns: A list of transformed lyrics combinations. :rtype: list .. py:method:: creating_control_combos(start=0, end=1, number=8) .. py:method:: lyrics_transformation(lyrics, replace_combos, control_combos=None) .. py:method:: brute_transpose_find_flag(lyrics, partial_flag, keys, verbose = False, wrap = True) Description: For the lyrics given :param lyrics: Lyrics given :type lyrics: str :param partial_flag: partial flag to look :type partial_flag: str :param verbose: _description_. Defaults to False. :type verbose: bool, optional :returns: possible flag :rtype: str .. py:method:: check_for_rot(text, partial='ecsc') Description: Checks if the text is a rotation of "ecsc". This function checks if the first four characters of the text can be rearranged to form the string "ecsc". It does this by comparing the ASCII values of the characters in the text with the ASCII values of the characters in "ecsc". If the conditions are met, it returns True, indicating that the text is a rotation of "ecsc". Otherwise, it returns False. This function is useful for identifying specific patterns in the text that match the structure of "ecsc", which could be relevant in certain Challenge_specific :param text: _description_ :type text: _type_ :returns: _description_ :rtype: _type_ .. py:method:: position_cipher(text, keys) Description: This function takes a text and a list of keys, and returns a new string where each character in the text is replaced by the character at the corresponding index in the keys list. If the index exceeds the length of the text, it wraps around using modulo operation. :param text: The input text to be transformed. :type text: str :param keys: A list of integers representing the positions in the text. :type keys: list :returns: A new string formed by replacing characters in the text based on the keys. :rtype: str .. py:method:: bruteforce_all_lyrics(all_lyrics, partial_flag, keys, verbose = False, wrap = True) .. py:method:: init_some_values() .. py:method:: another_attempt() .. py:method:: main()