Byte Entropy
v0.1.0Added Sep 26, 2026Sample dataShannon entropy over sliding windows of a binary, for spotting packed or encrypted sections.
cargo install kura-rs
kura add byte-entropyCopies the source file into your project. You own the code from then on.
If another tool already installs a kura command, run cargo install kura-rs --bin kura-rs and use kura-rs add instead.
use crate::parts::byte_entropy::windows;
for w in windows(&binary, 4096) {
if w.entropy > 7.2 {
println!("offset {:#x}: likely packed ({:.2} bits/byte)", w.offset, w.entropy);
}
}Verification
Sample dataChecked against scipy.stats.entropy 1.14 (Python) using property-based testing: the same inputs go to both implementations and the outputs are compared.
These numbers are placeholders. They have not been measured yet and must not be read as real results. This part is marked "sample": true in its registry file.
Benchmarks
Sample datakura-rs (Rust) against scipy.stats.entropy across input sizes. Faster at every measured input size, up to 35× faster.
These numbers are placeholders. They have not been measured yet and must not be read as real results. This part is marked "sample": true in its registry file.
Show data table
| Input size | kura-rs (Rust) | scipy.stats.entropy | Speedup |
|---|---|---|---|
| 4,096 | 0.01 ms | 0.35 ms | 35× |
| 65,536 | 0.09 ms | 2.9 ms | 32× |
| 1,048,576 | 1.4 ms | 44 ms | 31× |
| 16,777,216 | 22 ms | 700 ms | 32× |
Files
- parts/byte_entropy/mod.rs
Crate dependencies
None. Only the standard library.