d0mantasz/Project_Acoustic_Side_Channel
GitHub: d0mantasz/Project_Acoustic_Side_Channel
一个基于麦克风音频的声学侧信道攻击演示项目,用于分类和解码键盘敲击。
Stars: 0 | Forks: 0
# 声学侧信道攻击:基于麦克风录音的键盘敲击分类
**Domantas Prialgauskas · C00285607**
本项目演示了一种**声学侧信道攻击**,其中**键盘敲击**仅使用**麦克风音频**进行分类。
它采用了一个轻量级、可解释的流水线:
**RMS 分段 → 对齐起始的敲击窗口 → MFCC(+Δ,+ΔΔ)→ StandardScaler → SVM(RBF)→ 单词/句子解码(波束 + 词典)**
实时演示通过 **Streamlit GUI** 和 CLI 流水线脚本呈现。
## 项目结构(最小演示)
演示所需:
- `kbd_live_pipeline.py` — 核心分段 + MFCC + SVM + 解码
- `app.py` — Streamlit GUI
- `models_live_current/` — 训练工件(必须包含):
- `svm_model_live.joblib`
- `scaler_live.joblib`
- `meta_live.joblib`(可选但推荐)
- `wordlist_common_clean.txt`
- `AcousticSideChannelAttacks.html`(展示站点)
## 需求
- Windows 10/11
- 推荐 Python 3.10+
- 一个可用的麦克风(USB 麦克风或笔记本麦克风)
## 设置(笔记本电脑)
在项目文件夹中打开 PowerShell 并运行:
```
python -m venv .venv
.\.venv\Scripts\activate
python -m pip install --upgrade pip
pip install -r requirements.txt
## 使用下载的数据集训练模型并运行应用程序
```powershell
python kbd_pipeline.py train
python -m streamlit run app.py
## 使用 Streamlit 应用程序(启动后)
Once the app opens in your browser (usually `http://localhost:8501`):
### 1) 选择麦克风
Use the **Microphone / Input device** dropdown in the left sidebar.
- If recording fails or no taps are detected, try a different input device.
- Close other apps using the mic (Teams/Discord/Zoom/OBS).
### 2) 选择演示模式
In the sidebar, select one of:
**Mode 1 — Single letter (vote)**
- Press **Record & Decode**
- During recording, press the **same key** `N` times
- The app shows each tap prediction and a final majority-vote result
Recommended for quick validation (e.g., `a`, `q`, `t`, `b`, `SPACE`).
**Mode 2 — Fixed-length word**
- Set **Word length (L)** (e.g., 4 for “this”, 5 for “vote”)
- Press **Record & Decode**
- Type **one word** of exactly `L` letters
- The app shows:
- raw top-1 letters
- beam-search candidates
- decoded dictionary word
Recommended words: `this`, `vote`, `quit`, `devil`, `line`.
**Mode 3 — Sentence**
- Press **Record & Decode**
- Type a short sentence with spaces
- The app outputs:
- raw tap stream (including spaces)
- decoded words per chunk
Sentence mode is more sensitive to missed taps; type slightly slower.
### 3) 调节旋钮(需要时)
- **Sensitivity / Threshold (K)**: higher = fewer taps detected (more strict), lower = more taps detected (more false positives)
- **Debounce (ms)**: minimum time between taps; raise it if double-taps are being detected
- **Temperature / Beam width / Top-K**: decoding controls for word/sentence modes
- higher beam/top-K = more candidates (slower but often better)
- temperature > 1.0 makes decoding less “overconfident” and more flexible
---
## 故障排除
### “未找到模型”
Run training or copy the trained model folder:
```powershell
python kbd_live_pipeline.py train
```
标签:Apex, Caido项目解析, GUI应用, Kubernetes, MFCC, Python, RBF核, SEO侧信道, Streamlit, SVM, 侧信道分析, 信号处理, 后端开发, 命令控制, 声学侧信道攻击, 声纹攻击, 实时分类, 按键分类, 推理部署, 数据采集, 无后门, 时间序列特征, 机器学习, 束搜索解码, 标准化, 模型训练, 毕业论文, 流式处理, 特征提取, 网络安全项目, 访问控制, 词典解码, 语音识别, 逆向工具, 键盘推断, 键盘记录, 音频分析, 项目演示, 麦克风音频