Skip to content

Commit

Permalink
Merge branch 'main' into bee-update-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
SkeletalDemise authored Feb 9, 2023
2 parents ac00f21 + 5145a3f commit 081a7fe
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 29 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ path = "src/main.rs"
bench = false

[dependencies]
clap = {version = "4.1.1", features = ["derive"]}
clap = {version = "4.1.4", features = ["derive"]}
log = "0.4"
env_logger = "0.10.0"
base64 = "0.20.0"
base64 = "0.21.0"
rayon = "1.6.1"
lemmeknow = "0.7.0"
include_dir = "0.7.3"
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@
<h1>Project Ares</h1>
</p>

<p align="center">
<img src="https://raw.githubusercontent.com/bee-san/Ares/main/images/main_demo.svg" alt="Ares demo">
</p>


Ares is the next generation of decoding tools, built by the same people that brought you [Ciphey](https://github.com/ciphey/ciphey).

We fully intend to replace [Ciphey](https://github.com/ciphey/ciphey) with Ares.

✨ You can read more about Ares here https://skerritt.blog/introducing-ares/

# How to Use

The simplest way to use Ares is to join the [Discord Server](http://discord.skerritt.blog), head to the #bots channel and use ares with `$ares`. Type `$help` for helpful information!
Expand All @@ -29,6 +36,8 @@ Some features that may interest you, and that we're proud of.

## Fast

![](https://raw.githubusercontent.com/bee-san/Ares/main/images/better_demo.svg)

Ares is fast. Very fast. Other decoders such as Ciphey require advance artifical intelligence to determine which path it should take to decode (whether to try Caesar next or Base64 etc).

Ares is so fast we don't need to worry about this currently. For every 1 decode Ciphey can do, Ares can do ~7. That's a 700% increase in speed.
Expand Down Expand Up @@ -56,6 +65,8 @@ Ares already has ~120 tests, documentation tests (to ensure our docs are kept up

## LemmeKnow

![](https://raw.githubusercontent.com/bee-san/Ares/main/images/lemmeknow.svg)

<img width="861" alt="Screenshot 2022-12-18 at 17 08 36" src="https://user-images.githubusercontent.com/10378052/208310491-86e704ca-963d-4850-a2b2-f14b6e0f4797.png">

[LemmeKnow](https://github.com/swanandx/lemmeknow) is the Rust version of [PyWhat](https://github.com/bee-san/pyWhat). It's 33 times faster which means we can now decode and determine whether something is an IP address or whatnot 3300% faster than in Python.
Expand Down
9 changes: 9 additions & 0 deletions docs/package-managers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Packing Ares

Please call the main Ares program (the CLI) `ares_cli` and enable it to be called via `ares` in the terminal.

This is because `Ares` is a short name and is probably taken in a package manager already.

## Releases

Please base your package on our releases and not our GitHub repo. If you must, please call the package `ares_cli_rolling` to ensure people understand that the package updates on a rolling basis (as our GitHub repo updates).
2 changes: 1 addition & 1 deletion src/checkers/regex_checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl Check for Checker<RegexChecker> {

let regex_check_result = re.is_match(text);
let mut plaintext_found = false;
let printed_name = format!("Regex matched: {}", re);
let printed_name = format!("Regex matched: {re}");
if regex_check_result {
plaintext_found = true;
}
Expand Down
15 changes: 6 additions & 9 deletions src/cli_pretty_printing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ pub fn program_exiting_successful_decoding(result: DecoderResult) {
let decoded_path_coloured = ansi_term::Colour::Yellow.bold().paint(&decoded_path);
let decoded_path_string = if !decoded_path.contains('→') {
// handles case where only 1 decoder is used
format!("the decoder used is {}", decoded_path_coloured)
format!("the decoder used is {decoded_path_coloured}")
} else {
format!("the decoders used are {}", decoded_path_coloured)
format!("the decoders used are {decoded_path_coloured}")
};
println!(
"The plaintext is: \n{}\nand {}",
Expand All @@ -45,12 +45,12 @@ pub fn decoded_how_many_times(depth: u32) {
// Then we add 25 for Caesar
let decoders = crate::filtration_system::filter_and_get_decoders(&DecoderResult::default());
let decoded_times_int = depth * (decoders.components.len() as u32 + 25);
let decoded_times_str = format!("{} times", decoded_times_int);
let decoded_times_str = format!("{decoded_times_int} times");

let time_took = calculate_time_took(decoded_times_int);

// TODO add colour to the times
println!("\n🥳 Ares has decoded {} times.\nIf you would have used Ciphey, it would have taken you {}\n", decoded_times_str, time_took);
println!("\n🥳 Ares has decoded {decoded_times_str} times.\nIf you would have used Ciphey, it would have taken you {time_took}\n");
}

/// Whenever the human checker checks for text, this function is run.
Expand Down Expand Up @@ -95,7 +95,7 @@ fn calculate_time_took(decoded_times_int: u32) -> String {
format!("{} minutes", ciphey_how_long_to_decode_in_seconds / 60)
}
} else {
format!("{} seconds", ciphey_how_long_to_decode_in_seconds)
format!("{ciphey_how_long_to_decode_in_seconds} seconds")
}
}

Expand All @@ -112,10 +112,7 @@ pub fn countdown_until_program_ends(seconds_spent_running: u32, duration: u32) {
if time_left == 0 {
return;
}
println!(
"{} seconds have passed. {} remaining",
seconds_spent_running, time_left
);
println!("{seconds_spent_running} seconds have passed. {time_left} remaining");
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/decoders/base64_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
///
use crate::checkers::CheckerTypes;
use crate::decoders::interface::check_string_success;
use base64::{engine::general_purpose, Engine as _};

use super::crack_results::CrackResult;
use super::interface::Crack;
Expand Down Expand Up @@ -85,9 +86,12 @@ impl Crack for Decoder<Base64Decoder> {

/// helper function
fn decode_base64_no_error_handling(text: &str) -> Option<String> {
// Strip all padding
let text = text.replace('=', "");
// Runs the code to decode base64
// Doesn't perform error handling, call from_base64
base64::decode(text.as_bytes())
general_purpose::STANDARD_NO_PAD
.decode(text.as_bytes())
.ok()
.map(|inner| String::from_utf8(inner).ok())?
}
Expand Down
16 changes: 7 additions & 9 deletions src/decoders/base64_url_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
///
use crate::checkers::CheckerTypes;
use crate::decoders::interface::check_string_success;
use base64::{engine::general_purpose, Engine as _};

use super::crack_results::CrackResult;
use super::interface::Crack;
Expand Down Expand Up @@ -85,17 +86,14 @@ impl Crack for Decoder<Base64URLDecoder> {

/// helper function
fn decode_base64_url_no_error_handling(text: &str) -> Option<String> {
// Strip all padding
let text = text.replace('=', "");
// Runs the code to decode base64_url
// Doesn't perform error handling, call from_base64_url
base64::decode_engine(
text.as_bytes(),
&base64::engine::fast_portable::FastPortable::from(
&base64::alphabet::URL_SAFE,
base64::engine::fast_portable::PAD,
),
)
.ok()
.map(|inner| String::from_utf8(inner).ok())?
general_purpose::URL_SAFE_NO_PAD
.decode(text.as_bytes())
.ok()
.map(|inner| String::from_utf8(inner).ok())?
}

#[cfg(test)]
Expand Down
2 changes: 1 addition & 1 deletion src/decoders/caesar_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ mod tests {
// If we get here, the test passed
// Because the caesar_decoder.crack function returned None
// as it should do for the input
assert!(true);
assert!(true)
}
}
}

0 comments on commit 081a7fe

Please sign in to comment.