Enable multi-level decodings to actually work (Caesar) in multi-level paths #107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously when we had something like:
Ares (and Ciphey) would take the first decoding of Caesar (Rot1(X)) and pass that to Base64. This PR makes it so all 25 shifts of Caesar (and other similar ciphers) are passed to the decoders.
This works by....
Every
Text
struct contains a field:Which contains every decoding (even if it's just 1 decoding).
After each iteration of BFS we loop over all of our vectors we have collected and flatten them from a
Vec<Vec<Text>>
to aVec<Text>
wheretext: Vec<String>
has a single element (meaning we can index into the 0th element [0] and get the result).This introduces some issues:
This is a hack to get us to support this feature.
In the future we might want to look at:
Editing this bit of code so it supports Vectors of Vectors:
https://github.com/bee-san/Ares/blob/1bcc994052db17e7db948055d012810353c76f4d/src/searchers/bfs.rs#LL32-L33C69
Or adding another loop below this code so it turns into a O(n^2) nested loop:
Ares/src/searchers/bfs.rs
Line 26 in 1bcc994