Skip to main content

keyhog_scanner/decode/
mod.rs

1//! Decode-through scanning: decode base64 and hex strings before pattern matching.
2//!
3//! Catches secrets hidden behind encoding layers - Kubernetes manifests,
4//! CI/CD configs, and hex-encoded credentials.
5
6mod base64;
7pub mod caesar;
8pub mod hex;
9mod json;
10mod pipeline;
11pub mod reverse;
12mod url;
13pub mod util;
14
15pub use base64::{base64_decode, find_base64_strings, z85_decode};
16pub use hex::hex_decode;
17pub use pipeline::{decode_chunk, register_decoder};
18
19use keyhog_core::Chunk;
20
21/// A trait for decoding chunks to find hidden secrets.
22pub trait Decoder: Send + Sync {
23    fn name(&self) -> &'static str;
24    fn decode_chunk(&self, chunk: &Chunk) -> Vec<Chunk>;
25}
26
27/// Candidate encoded string discovered during pre-decoding extraction.
28pub struct EncodedString {
29    pub value: String,
30}