pub struct StatisticalAnalyzer {
pub significance_level: f64,
}Expand description
Comprehensive traffic statistical analyzer.
Fields§
§significance_level: f64P-value threshold for significance.
Implementations§
Source§impl StatisticalAnalyzer
impl StatisticalAnalyzer
pub fn new() -> Self
pub fn with_significance(self, level: f64) -> Self
Sourcepub fn byte_entropy(&self, data: &[u8]) -> f64
pub fn byte_entropy(&self, data: &[u8]) -> f64
Shannon entropy of a byte distribution (0.0–8.0).
Sourcepub fn entropy_analysis(&self, data: &[u8]) -> AnalysisResult
pub fn entropy_analysis(&self, data: &[u8]) -> AnalysisResult
Analyze byte entropy: encrypted/random data should be close to 8.0.
Sourcepub fn chi_squared_uniformity(&self, data: &[u8]) -> AnalysisResult
pub fn chi_squared_uniformity(&self, data: &[u8]) -> AnalysisResult
Chi-squared test for uniformity of byte distribution.
Sourcepub fn pattern_detection(&self, packet_sizes: &[usize]) -> AnalysisResult
pub fn pattern_detection(&self, packet_sizes: &[usize]) -> AnalysisResult
Test for repeated patterns in packet sizes.
Sourcepub fn timing_regularity(
&self,
inter_packet_delays_us: &[u64],
) -> AnalysisResult
pub fn timing_regularity( &self, inter_packet_delays_us: &[u64], ) -> AnalysisResult
Timing regularity analysis: detect constant-rate traffic.
Sourcepub fn full_analysis(
&self,
payload: &[u8],
packet_sizes: &[usize],
delays_us: &[u64],
) -> Vec<AnalysisResult>
pub fn full_analysis( &self, payload: &[u8], packet_sizes: &[usize], delays_us: &[u64], ) -> Vec<AnalysisResult>
Run all analysis tests on a traffic sample.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StatisticalAnalyzer
impl RefUnwindSafe for StatisticalAnalyzer
impl Send for StatisticalAnalyzer
impl Sync for StatisticalAnalyzer
impl Unpin for StatisticalAnalyzer
impl UnsafeUnpin for StatisticalAnalyzer
impl UnwindSafe for StatisticalAnalyzer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more