elliotwutingfeng/passwordsim
GitHub: elliotwutingfeng/passwordsim
基于 Damerau-Levenshtein 距离算法的密码相似度搜索工具,用于在密码数据集中查找与指定密码相近的变体。
Stars: 7 | Forks: 0
# passwordsim
[](https://pkg.go.dev/github.com/elliotwutingfeng/passwordsim)
[](https://coveralls.io/github/elliotwutingfeng/passwordsim?branch=main)
[](LICENSE)
## 概述
**passwordsim** 允许您在任何密码数据集中搜索与您指定密码相似的密码。使用的相似度度量标准是 [Damerau-Levenshtein](https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance) 距离。
## 用例
- 选择强密码
- 猜测密码变体
## 要求
在 Linux x64 上测试
- 快速的多核 CPU
- 对于大型数据集(多 GB),建议至少拥有 32 GB RAM
- Go 1.19
## 安装
```
go get github.com/elliotwutingfeng/passwordsim
```
## 设置
passwordsim 可执行文件将在 **'dist/'** 文件夹中创建
```
make build_cli
```
## 使用方法
在 **'test/passwords.txt'** 中搜索与 '[correct horse battery staple](https://xkcd.com/936)' 相似的密码,且归一化 Damerau-Levenshtein 距离得分不超过 **0.3**。
```
dist/passwordsim -f 'test/passwords.txt' -o 'output.txt' -p 'correct horse battery staple' -t 0.3
```
对于 Windows 系统,请使用反斜杠 `\`。
### 终端输出
```
Searching for similar passwords...
3 similar passwords found in 'test/passwords.txt'. Threshold: 0.30
Results saved to file 'output.txt'.
```
### 文件输出
**文件名:** output.txt
```
correct horse battery staple 0
incorrect horse battery staple 0.06666666666666667
incorrect horse battery st@ple 0.1
```
每个密码右侧的数字是其相对于您指定密码的 [归一化 Damerau-Levenshtein 距离得分](https://github.com/lmas/Damerau-Levenshtein)。得分范围从 0 到 1。该数字越小,表示密码越相似。0 表示完全匹配。
## 密码数据集
- [SecLists](https://github.com/danielmiessler/SecLists)
- [Xato.net 1000 万个密码](https://xato.net/today-i-am-releasing-ten-million-passwords-b6278bbe7495)
- [Weekpass](https://weakpass.com)
标签:EVTX分析, Go, Ruby工具, 密码分析, 密码学, 手动系统调用, 数据检索, 文档结构分析, 日志审计