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;
7mod hex;
8mod pipeline;
9mod url;
10
11pub use base64::{base64_decode, find_base64_strings, z85_decode};
12pub use hex::hex_decode;
13pub use pipeline::{decode_chunk, register_decoder};
14
15use keyhog_core::Chunk;
16
17/// A trait for decoding chunks to find hidden secrets.
18pub trait Decoder: Send + Sync {
19    fn name(&self) -> &'static str;
20    fn decode_chunk(&self, chunk: &Chunk) -> Vec<Chunk>;
21}
22
23/// Candidate encoded string discovered during pre-decoding extraction.
24pub struct EncodedString {
25    pub value: String,
26}