ctfsolver.src.position_cipher_functions¶
Classes¶
Module Contents¶
- class PositionCipher[source]¶
-
- lyrics_all()[source]¶
- 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.
- Return type:
- brute_transpose_find_flag(lyrics, partial_flag, keys, verbose=False, wrap=True)[source]¶
- Description:
For the lyrics given
- check_for_rot(text, partial='ecsc')[source]¶
- 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
- Parameters:
text (_type_) – _description_
- Returns:
_description_
- Return type:
_type_
- position_cipher(text, keys)[source]¶
- 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.