### Install Ciphey using Cargo Source: https://github.com/bee-san/ares/blob/main/docs/README.md Install the ciphey tool using the Cargo package manager. This is the quickest way to get started. ```bash cargo install ciphey ``` -------------------------------- ### Implement First-Run Enhanced Detection Setup Source: https://github.com/bee-san/ares/blob/main/docs/enhanced_detection_plan.md This function handles the initial setup for enhanced detection. It prompts the user, securely reads a Hugging Face token, downloads the AI model, and updates the configuration if successful. Errors during download are reported to the user. ```rust // src/cli/first_run.rs use rpassword::read_password_from_tty; use gibberish_or_not::{download_model_with_progress_bar, default_model_path}; use std::path::{Path, PathBuf}; // ... existing code ... pub fn run_first_time_setup() -> std::collections::HashMap { // ... existing code ... let mut config = /* ... existing config hashmap ... */; if ask_yes_no_question( "Would you like to enable Enhanced Plaintext Detection?\n\nThis will increase accuracy by around 40%, and you will be asked less frequently if something is plaintext or not.\n\nThis will download a 500mb AI model.\n\nYou will need to follow these steps to download it.\n1. Make a HuggingFace account https://huggingface.co/\n2. Make a READ Token https://huggingface.co/settings/tokens\n\nNote: You will be able to do this later by running `ciphey --enable-enhanced-detection`\n\nWe will prompt you for the token if you click Yes. We will not store this token, only use it to download the model and then throw away on reboot (y/N)", false, ) { let token = read_password_from_tty(Some("Hugging Face Token: ")).expect("Failed to read token from TTY"); // Define the path to store models let mut config_dir_path = get_config_file_path(); config_dir_path.pop(); config_dir_path.push("models"); // Create folder if it doesn't exist std::fs::create_dir_all(&config_dir_path).expect("Could not create models directory"); let model_path: PathBuf = default_model_path(); if let Err(e) = download_model_with_progress_bar(&model_path, Some(&token)) { println!("{}", print_warning(format!("Error downloading model: {}", e))); } else { println!("{}", print_statement("Enhanced detection enabled.")); config.insert("enhanced_detection".to_string(), "true".to_string()); config.insert("model_path".to_string(), model_path.display().to_string()); } } // ... existing code ... config } ``` -------------------------------- ### Basic Ciphey Usage Source: https://github.com/bee-san/ares/blob/main/images/repomix-output.txt Demonstrates how to use Ciphey for basic decryption. This example shows the command-line arguments for specifying an input file and a regex pattern to aid decryption. ```bash echo 'ciphey supports file input, and regular expressions. If you know a part of the plaintext you can use regex as a crib' ``` ```bash ciphey -f crack.txt -r hello ``` -------------------------------- ### Ciphey Output Example Source: https://github.com/bee-san/ares/blob/main/images/repomix-output.txt Shows the typical output from Ciphey after a successful decryption. It indicates the matched regex, the proposed plaintext, and the decoders used. ```text 🕵️ I think the plaintext is Regex matched: hello. Possible plaintext: 'hello, world!' (y/N): y 🥳 ciphey has decoded 205 times times. If you would have used Ciphey, it would have taken you 41 seconds The plaintext is: hello, world! and the decoders used are Atbash → Caesar Cipher → Base64 → Caesar Cipher ``` -------------------------------- ### Basic Ciphey Decoding Example Source: https://github.com/bee-san/ares/blob/main/docs/using_ares.md Demonstrates the basic usage of Ciphey to decode a Base64 encoded string. Shows the decoded text and the decoder used. ```bash ciphey "SGVsbG8sIFdvcmxkIQ==" ``` -------------------------------- ### Database Operations Example Source: https://github.com/bee-san/ares/blob/main/docs/database_implementation.md Demonstrates how to interact with the database module in the main program flow. Includes initializing the database, inserting cache entries, and inserting statistics after a successful decode operation. Requires 'Uuid' for run ID generation and 'serde_json' for path serialization. ```rust // In main.rs let run_id = Uuid::new_v4().to_string(); let db = Database::new()?; // After successful decode if let Some(result) = final_result { db.insert_cache(&CacheEntry { encoded_text: input, decoded_text: result.text, path: serde_json::to_string(&result.path)?, execution_time_ms: duration.as_millis() as i64, })?; db.insert_statistics(&StatisticsEntry { run_id: &run_id, decoder_stats: &decoder_stats, search_depth: curr_depth, seen_strings_count: seen_count, prune_threshold, max_memory_kb: get_memory_usage()?, })?; } ``` -------------------------------- ### Multi-level Decoding Example Source: https://github.com/bee-san/ares/blob/main/docs/using_ares.md Ciphey automatically handles multiple levels of encoding, such as Base64 followed by Hexadecimal and ROT13. ```bash # Base64 → Hex → ROT13 ciphey "NTc2ODY1NmM2YzZmMmMyMDU3NmY3MjZjNjQyMQ==" # Output: Hello, World! ``` -------------------------------- ### Perform Cracking using Ciphey Rust API Source: https://github.com/bee-san/ares/blob/main/docs/using_ares.md Demonstrates how to use the Ciphey Rust library to perform decoding. It shows the setup with default configuration and how to handle the decoding result. ```rust use ciphey::perform_cracking; use ciphey::config::Config; fn main() { let config = Config::default(); let result = perform_cracking("SGVsbG8sIFdvcmxkIQ==", config); if let Some(decoder_result) = result { println!("Decoded: {}", decoder_result.text[0]); } else { println!("Failed to decode"); } } ``` -------------------------------- ### Update Config Module for First Run (Rust) Source: https://github.com/bee-san/ares/blob/main/docs/first_run_implementation_plan.md Modifies the `get_config_file_into_struct` function to trigger the first-run setup if the config file does not exist. It then saves the user's choices to the config file. ```rust // Modify in src/config/mod.rs pub fn get_config_file_into_struct() -> Config { let path = get_config_file_path(); if !path.exists() { // This is the first run, show the TUI let colors = crate::cli::first_run::run_first_time_setup(); // Create a default config with the selected colors let mut config = Config::default(); config.colourscheme = colors; // Save the config to file let toml_string = toml::to_string_pretty(&config).expect("Could not serialize config"); let mut file = File::create(&path).expect("Could not create config file"); file.write_all(toml_string.as_bytes()).expect("Could not write to config file"); return config; } // Existing code for reading config file... } ``` -------------------------------- ### Wordlist Format Example Source: https://github.com/bee-san/ares/blob/main/docs/hash_crack_decoder_plan.md Wordlists are structured with each line containing a hash and its corresponding plaintext, separated by a colon. This format is used for efficient lookup. ```plaintext 5f4dcc3b5aa765d61d8327deb882cf99:password e10adc3949ba59abbe56e057f20f883e:123456 ``` -------------------------------- ### Get Config File Path Source: https://github.com/bee-san/ares/blob/main/docs/config_file_implementation_plan.md This function determines the path to the configuration file, creating the necessary directory in the user's home directory if it doesn't exist. ```rust use std::fs::{self, File}; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use dirs::home_dir; use toml::{from_str, to_string_pretty}; // Get the path to the config file pub fn get_config_file_path() -> PathBuf { let mut path = home_dir().expect("Could not find home directory"); path.push("ciphey"); fs::create_dir_all(&path).expect("Could not create ciphey directory"); path.push("config.toml"); path } ``` -------------------------------- ### Get Database Path Source: https://github.com/bee-san/ares/blob/main/docs/database_implementation.md Retrieves the absolute path to the SQLite database file, creating necessary directories if they don't exist. Ensures the database is located in the user's home directory under 'ciphey/database.sqlite'. ```rust use std::env; use std::path::PathBuf; fn get_database_path() -> PathBuf { let mut path = env::home_dir().expect("Could not find home directory"); path.push("ciphey"); path.push("database.sqlite"); path } ``` -------------------------------- ### Build Ciphey with Docker Source: https://github.com/bee-san/ares/blob/main/docs/ares_overview.md Clone the ciphey repository and build the Docker image. ```bash git clone https://github.com/bee-san/ciphey cd ciphey docker build . ``` -------------------------------- ### AStarNode Struct with Next Decoder Source: https://github.com/bee-san/ares/blob/main/docs/astar_algorithm_improvements.md Defines the AStarNode struct, now including an optional `next_decoder_name` field to guide the search towards specific decoders. ```rust struct AStarNode { // Existing fields state: DecoderResult, cost: u32, heuristic: f32, total_cost: f32, // New field next_decoder_name: Option, } ``` -------------------------------- ### Build and Run Ciphey with Docker Source: https://github.com/bee-san/ares/blob/main/docs/using_ares.md Use Docker to build and run Ciphey. This provides an isolated environment for using the tool. ```bash git clone https://github.com/bee-san/ciphey cd ciphey docker build -t ciphey . docker run -it ciphey ``` -------------------------------- ### Project Dependencies Source: https://github.com/bee-san/ares/blob/main/docs/database_implementation.md Lists the necessary dependencies for the project, including 'rusqlite' for SQLite interaction, 'serde_json' for JSON serialization, 'uuid' for generating unique run IDs, and 'directories' for managing application directories. ```toml [dependencies] rusqlite = { version = "0.29", features = ["bundled"] } serde_json = "1.0" uuid = { version = "1.0", features = ["v4"] } directories = "5.0" # For managing app directories ``` -------------------------------- ### Filter Decoders by Popularity Threshold Source: https://github.com/bee-san/ares/blob/main/docs/astar_node_with_decoder_implementation_plan.md Before creating nodes, filter out decoders with low popularity to reduce memory overhead. This example keeps decoders with a popularity score above 0.2. ```rust let filtered_decoders = all_available_decoders.components.into_iter() .filter(|decoder| { // Filter based on decoder properties // For example, only keep decoders with popularity above a threshold decoder.get_popularity() > 0.2 }) .collect::>(); // Create nodes only for the filtered decoders for next_decoder in filtered_decoders { // Create new node... } ``` -------------------------------- ### Build Ciphey from Source Source: https://github.com/bee-san/ares/blob/main/docs/using_ares.md Build the Ciphey binary from its source code using Cargo. This method is useful for development or if you need the latest changes. ```bash git clone https://github.com/bee-san/ciphey cd ciphey cargo build --release ``` -------------------------------- ### CLI: Loading and Passing Wordlist to Library Source: https://github.com/bee-san/ares/blob/main/docs/changes/wordlist.md This code demonstrates how the CLI handles loading a wordlist from a specified path and passing it to the library via the Config struct. It includes error handling for wordlist loading. ```rust fn main() { // ... existing code let opts: Opts = Opts::parse(); let mut config = get_config(); // Handle wordlist if provided if let Some(wordlist_path) = &opts.wordlist { match load_wordlist(wordlist_path) { Ok(wordlist) => { config.wordlist = Some(wordlist); }, Err(e) => { eprintln!("Error loading wordlist '{}': {}", wordlist_path, e); std::process::exit(1); } } } // Pass the config with pre-loaded wordlist to the library let result = perform_cracking(&text, config); // ... rest of the function } ``` -------------------------------- ### Get or Download Wordlist Source: https://github.com/bee-san/ares/blob/main/docs/hash_crack_decoder_plan.md Manages local wordlist files. It checks for an existing wordlist in the cache directory for the given hash type and downloads it from S3 if it's not found. ```rust fn get_or_download_wordlist(hash_type: &HashType) -> Option { let cache_dir = PathBuf::from("cache/wordlists"); fs::create_dir_all(&cache_dir).ok()?; let filename = match hash_type { HashType::MD5 => "md5_wordlist.txt", HashType::SHA1 => "sha1_wordlist.txt", HashType::SHA256 => "sha256_wordlist.txt", HashType::Unknown => return None, }; let local_path = cache_dir.join(filename); // If the wordlist exists locally, return its path if local_path.exists() { return Some(local_path); } // Otherwise, download it from S3 download_wordlist_from_s3(filename, &local_path).map(|_| local_path) } ``` -------------------------------- ### Load Wordlist from Config File Source: https://github.com/bee-san/ares/blob/main/docs/changes/wordlist.md Handles loading a wordlist from the configuration file. If the wordlist cannot be loaded, it prints an error and exits. ```rust // In the function that loads the config file // (likely in src/config/mod.rs) pub fn get_config_file_into_struct() -> Config { // ... existing code // If wordlist is specified in config file, set it in the config struct if let Some(wordlist_path) = config_values.get("wordlist") { config.wordlist_path = Some(wordlist_path.to_string()); // Load the wordlist here in the config layer match load_wordlist(wordlist_path) { Ok(wordlist) => { config.wordlist = Some(wordlist); }, Err(e) => { // Critical error - exit if config specifies wordlist but can't load it eprintln!("Can't load wordlist at '{}'. Either fix or remove wordlist from config file at '{}'", wordlist_path, config_file_path); std::process::exit(1); } } } // ... rest of the function } ``` -------------------------------- ### Import and Use Storage Resources Source: https://github.com/bee-san/ares/blob/main/docs/storage.md Demonstrates how to import and utilize the ENGLISH_FREQS and INVISIBLE_CHARS from the storage module in your Rust code. ```rust use crate::storage::ENGLISH_FREQS; use crate::storage::INVISIBLE_CHARS; // Example: Using English frequencies for analysis fn analyze_text(text: &str) { // ...frequency analysis using ENGLISH_FREQS... } // Example: Checking for invisible characters fn check_for_invisible(text: &str) -> bool { text.chars().any(|c| INVISIBLE_CHARS.contains(&c)) } ``` -------------------------------- ### Get or Download Rainbow Table Source: https://github.com/bee-san/ares/blob/main/docs/hash_crack_decoder_plan.md Manages local rainbow table storage. It checks for an existing rainbow table in the cache directory for the given hash type and size, and downloads it if not found. ```rust fn get_or_download_rainbow_table(hash_type: &HashType, size_gb: usize) -> Option { let cache_dir = PathBuf::from("cache/rainbow_tables"); fs::create_dir_all(&cache_dir).ok()?; let dirname = match hash_type { HashType::MD5 => format!("md5_{}gb", size_gb), HashType::SHA1 => format!("sha1_{}gb", size_gb), HashType::SHA256 => format!("sha256_{}gb", size_gb), HashType::Unknown => return None, }; let local_path = cache_dir.join(&dirname); // If the rainbow table exists locally, return its path if local_path.exists() { return Some(local_path); } // Otherwise, download it download_rainbow_table(hash_type, size_gb, &local_path).map(|_| local_path) } ``` -------------------------------- ### Read Input from File with CLI Option Source: https://github.com/bee-san/ares/blob/main/docs/using_ares.md Use the --file option to specify an input file for Ciphey to process. ```bash ciphey --file input.txt ``` -------------------------------- ### First-Run Flowchart Source: https://github.com/bee-san/ares/blob/main/docs/first_run_implementation_plan.md Visual representation of the initial program execution flow, including configuration checks and TUI interactions. ```mermaid flowchart TD A[Program Start] --> B{Config File Exists?} B -->|No| C[Launch First-Run TUI] C --> D[Display Welcome Message] D --> E{Want Custom Colors?} E -->|No| F[Use Default Colors] E -->|Yes| G[Show Color Scheme Options] G --> H{Choose Scheme} H -->|Capptucin| I[Use Capptucin Colors] H -->|Darcula| J[Use Darcula Colors] H -->|Default| K[Use Default Colors] H -->|Custom| L[Prompt for RGB Values] I --> M[Create Config File] J --> M K --> M L --> M F --> M M --> N[Continue Program] B -->|Yes| N ``` -------------------------------- ### Run Ciphey with a Token Source: https://github.com/bee-san/ares/blob/main/images/repomix-output.txt This command executes Ciphey with a provided authentication token. Ensure the token is kept secure. ```bash ➜ ~ ciphey -t '7Vqt2YuAvPvTXQTHVLjPvp4BM2ZJpZWYL' ``` -------------------------------- ### Configure Rayon Thread Pool Source: https://github.com/bee-san/ares/blob/main/docs/parallel_astar_implementation.md Configure Rayon's thread pool at the start of your program to control the number of threads used for parallel processing. This can be useful for optimizing performance on systems with varying core counts. ```rust rayon::ThreadPoolBuilder::new() .num_threads(num_cpus::get()) .build_global() .unwrap(); ``` -------------------------------- ### Update CLI Help Text for Wordlist Option Source: https://github.com/bee-san/ares/blob/main/docs/changes/wordlist.md Provides descriptive help text for the `--wordlist` CLI argument, explaining its purpose and precedence. ```rust // In the help text for the CLI /// Path to a wordlist file containing newline-separated words /// The checker will perform exact matching against these words /// Takes precedence over config file if both specify a wordlist #[arg(long, help = "Path to a wordlist file with newline-separated words for exact matching")] wordlist: Option, ``` -------------------------------- ### Create Default Config File Source: https://github.com/bee-san/ares/blob/main/docs/config_file_implementation_plan.md Creates a default configuration file if one does not exist. It serializes a default `Config` struct to TOML and writes it to the determined file path. ```rust // Create a default config file pub fn create_default_config_file() -> Result<(), std::io::Error> { let config = Config::default(); let toml_string = to_string_pretty(&config).expect("Could not serialize config"); let path = get_config_file_path(); let mut file = File::create(path)?; file.write_all(toml_string.as_bytes())?; Ok(()) } ``` -------------------------------- ### A* Node Creation with Next Decoder Source: https://github.com/bee-san/ares/blob/main/docs/astar_node_with_decoder_implementation_plan.md This snippet demonstrates the creation of new A* nodes within the main loop. Each new node is configured with a specific 'next_decoder' value, allowing the search to branch based on potential decoder applications. The cost and heuristic are recalculated for each new node. ```rust let all_available_decoders = get_all_decoders(); for next_decoder in all_available_decoders.components { // Create new node with updated cost, heuristic, and next_decoder let cost = current_node.cost + 1; let heuristic = generate_heuristic(&text[0], &decoders_used, &Some(next_decoder.clone())); let total_cost = cost as f32 + heuristic; let new_node = AStarNode { state: DecoderResult { text: text.clone(), path: decoders_used.clone(), }, cost, heuristic, total_cost, next_decoder: Some(next_decoder), }; // Add to open set open_set.push(new_node); } ``` -------------------------------- ### Creating a New AStarNode Source: https://github.com/bee-san/ares/blob/main/docs/astar_decoder_specific_nodes.md Illustrates how to create a new AStarNode, setting the next_decoder_name to specify which decoder to attempt next. ```rust let new_node = AStarNode { state: DecoderResult { text, path: decoders_used, }, cost, heuristic, total_cost, next_decoder_name: Some(r.decoder.to_string()), }; ``` -------------------------------- ### Add Dependencies to Cargo.toml Source: https://github.com/bee-san/ares/blob/main/docs/first_run_implementation_plan.md Add `ratatui` and `crossterm` to your `Cargo.toml` file to enable TUI functionality. ```toml [dependencies] # Existing dependencies... ratatui = "0.26.1" crossterm = "0.27.0" ``` -------------------------------- ### Save Output to File with CLI Option Source: https://github.com/bee-san/ares/blob/main/docs/using_ares.md Use the --output option to specify a file where Ciphey should save its results. ```bash ciphey --output result.txt "your encoded text" ``` -------------------------------- ### Run Ciphey with File Input Source: https://github.com/bee-san/ares/blob/main/images/repomix-output.txt Use the -f flag to specify an input file for Ciphey to process. This is useful for analyzing larger amounts of encoded text. ```bash ciphey -f crack.txt -r hello ``` -------------------------------- ### Add Dependencies to Cargo.toml Source: https://github.com/bee-san/ares/blob/main/docs/config_file_implementation_plan.md Include necessary crates for configuration file handling, such as `dirs` for path resolution, `toml` for parsing, and `serde` for serialization/deserialization. ```toml [dependencies] # Existing dependencies... dirs = "5.0.1" toml = "0.8.10" serde = { version = "1.0.197", features = ["derive"] } ``` -------------------------------- ### Add Dependencies to Cargo.toml Source: https://github.com/bee-san/ares/blob/main/docs/enhanced_detection_plan.md Add `rpassword` for secure token input and ensure `gibberish-or-not` is at version 4.1.1 or greater. ```toml [dependencies] # Existing dependencies... rpassword = "0.13.0" gibberish-or-not = "4.1.1" ``` -------------------------------- ### Use Ciphey Command Line Source: https://github.com/bee-san/ares/blob/main/docs/README.md Execute ciphey from the command line to decode a given string. Replace 'your encoded text here' with the actual encoded content. ```bash ciphey "your encoded text here" ``` -------------------------------- ### Library API: Accepting Pre-loaded Wordlist Source: https://github.com/bee-san/ares/blob/main/docs/changes/wordlist.md This snippet shows how to modify the LibraryInput struct and its methods to accept a pre-loaded HashSet of strings. This allows users to provide their wordlist directly to the library. ```rust pub struct LibraryInput { // ... existing fields /// Pre-loaded wordlist (allows library users to provide wordlist directly) pub wordlist: Option>, } impl LibraryInput { // ... existing methods /// Set a pre-loaded wordlist pub fn with_wordlist(mut self, wordlist: HashSet) -> Self { self.wordlist = Some(wordlist); self } } ``` ```rust fn library_input_to_config(input: LibraryInput) -> Config { let mut config = Config::default(); // ... existing conversion code // Handle wordlist - just pass the pre-loaded HashSet config.wordlist = input.wordlist; config } ``` ```rust pub fn perform_cracking(text: &str, config: Config) -> Option { // ... existing code // The wordlist is already loaded by the CLI/config layer // Just set the config config::set_global_config(config); // ... rest of the function } ``` -------------------------------- ### Welcome Screen TUI Design Source: https://github.com/bee-san/ares/blob/main/docs/first_run_implementation_plan.md The initial screen displayed to the user on their first run, prompting for color scheme preferences. ```text 🤠 Howdy! This is your first time running ciphey. I need to ask you some questions to make it work better for you. Do you want a custom colour scheme? (y/N) ``` -------------------------------- ### Use ThreadSafePriorityQueue for Open Set Source: https://github.com/bee-san/ares/blob/main/docs/parallel_astar_implementation_clarifications.md Always use the `ThreadSafePriorityQueue` wrapper for your open set to ensure thread-safe operations. Avoid directly using `BinaryHeap` methods on it. ```rust // Don't do this: open_set.push(node); // This assumes open_set is a BinaryHeap // Do this instead: open_set.push(node); // This uses the push method of ThreadSafePriorityQueue ``` -------------------------------- ### Node Expansion with Decoder Filtering Source: https://github.com/bee-san/ares/blob/main/docs/astar_decoder_specific_nodes.md Shows how to expand an AStarNode by checking for a specific next_decoder_name and filtering available decoders accordingly. This avoids trying all decoders. ```rust // Determine which decoders to use based on next_decoder_name let mut decoders; if let Some(decoder_name) = ¤t_node.next_decoder_name { // If we have a specific decoder name, filter all decoders to only include that one trace!("Using specific decoder: {}", decoder_name); let mut all_decoders = get_all_decoders(); all_decoders.components.retain(|d| d.get_name() == decoder_name); // Update stats for the decoder if !all_decoders.components.is_empty() { update_decoder_stats(decoder_name, true); } decoders = all_decoders; } else { decoders = get_decoder_tagged_decoders(¤t_node.state); } ``` -------------------------------- ### Enable Human Verification with CLI Option Source: https://github.com/bee-san/ares/blob/main/docs/using_ares.md Use the --human option to enable interactive human verification for decoding results. ```bash ciphey --human "your encoded text" ``` -------------------------------- ### Ciphey Decoding with Regex Matching Source: https://github.com/bee-san/ares/blob/main/docs/using_ares.md Shows how to use Ciphey with a regex pattern to decode a Base64 encoded string that is expected to match a specific format (e.g., a flag). ```bash ciphey --regex "flag\{.*\}" "SGxhZXtjcnlwdG9fMTIzfQ==" ``` -------------------------------- ### Library API: Accepting Pre-loaded Wordlists Source: https://github.com/bee-san/ares/blob/main/docs/wordlist.md Modifies the LibraryInput struct to optionally accept a pre-loaded HashSet, allowing users to provide their own wordlists directly to the library. ```rust pub struct LibraryInput { // ... existing fields /// Pre-loaded wordlist (allows library users to provide wordlist directly) pub wordlist: Option>, } impl LibraryInput { // ... existing methods /// Set a pre-loaded wordlist pub fn with_wordlist(mut self, wordlist: HashSet) -> Self { self.wordlist = Some(wordlist); self } } ``` ```rust fn library_input_to_config(input: LibraryInput) -> Config { let mut config = Config::default(); // ... existing conversion code // Handle wordlist - just pass the pre-loaded HashSet config.wordlist = input.wordlist; config } ``` ```rust pub fn perform_cracking(text: &str, config: Config) -> Option { // ... existing code // The wordlist is already loaded by the CLI/config layer // Just set the config config::set_global_config(config); // ... rest of the function ``` -------------------------------- ### Import Concurrency and Parallelism Crates Source: https://github.com/bee-san/ares/blob/main/docs/parallel_astar_implementation.md Add these `use` statements to `src/searchers/astar.rs` to bring the necessary parallel and concurrent types into scope. ```rust use rayon::prelude::*; use crossbeam::queue::SegQueue; use dashmap::DashSet; use std::sync::Mutex; use std::cmp::Reverse; ``` -------------------------------- ### Multi-level Decoding with Ciphey Source: https://github.com/bee-san/ares/blob/main/docs/using_ares.md Illustrates Ciphey's capability to perform multi-level decoding, handling nested encodings like Hexadecimal, Base64, and ROT13. The output shows the final decoded text and the sequence of decoders applied. ```bash ciphey "726f743133286261736536342864656328225a6d7868655841674d5449674d7a51674e6a6373494449774d6a4d3d222929" ``` -------------------------------- ### Ciphey Efficiency Comparison Source: https://github.com/bee-san/ares/blob/main/images/repomix-output.txt This output compares the time taken by Ciphey to decode content versus a hypothetical manual approach, highlighting Ciphey's efficiency. ```text If you would have used Ciphey, it would have taken you 41 seconds ``` -------------------------------- ### Key Press Simulation Source: https://github.com/bee-san/ares/blob/main/images/repomix-output.txt Simulates pressing various keys, including special keys and key combinations with Ctrl. Optional delay can be specified. ```bash Escape Backspace Delete Insert Down Enter Space Tab Left Right Up PageUp PageDown Ctrl+C ``` -------------------------------- ### Set Terminal Properties Source: https://github.com/bee-san/ares/blob/main/images/repomix-output.txt Configure terminal window size and font. Use 'Set Shell' to specify the shell environment. ```bash Set Shell "bash" Set FontSize 32 Set Width 1200 Set Height 600 ``` -------------------------------- ### Window and Typing Speed Settings Source: https://github.com/bee-san/ares/blob/main/images/repomix-output.txt Adjusts window bar size and terminal typing speed. Default values are provided. ```bash # Set WindowBarSize Set window bar size, in pixels. Default is 40. # Set TypingSpeed