Skip to content

Commit fc74305

Browse files
cursoragentscript3r
andcommitted
feat: Add cryptofind CLI and core scanner functionality
Co-authored-by: script3r <[email protected]>
1 parent 4a3ac72 commit fc74305

File tree

34 files changed

+2718
-0
lines changed

34 files changed

+2718
-0
lines changed

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## Contributing to cryptofind
2+
3+
Thank you for improving cryptofind! This project aims for speed, precision, and extensibility.
4+
5+
### Adding a New Library via patterns
6+
7+
1. Edit `patterns.toml` and add a new `[[library]]` entry.
8+
2. Use anchored regexes for `include`/`import`/`namespace`/`apis`.
9+
3. Prefer import/include anchors; use API patterns only as secondary evidence.
10+
4. Run `cargo test` to validate regex and stripper behavior.
11+
12+
### Adding a New Language or Custom Detector
13+
14+
1. Create a new crate under `crates/detector-<lang>/`.
15+
2. Implement the `Detector` trait from `scanner-core`.
16+
3. Provide `prefilter()` substrings and extensions for fast filtering.
17+
4. Use comment stripping utilities to avoid matches in comments/strings.
18+
19+
### Performance Guidelines
20+
21+
- Stream files and avoid unnecessary allocations.
22+
- Use `rayon` for parallelism; keep per-file work independent.
23+
- Prefer `aho-corasick` for prefilter substring matching.
24+
- Short-circuit after sufficient evidence unless `--exhaustive` (future work).
25+
26+
### Testing
27+
28+
- Add unit tests for any new stripper rules.
29+
- Provide fixtures under `fixtures/<lang>/positive` and `fixtures/<lang>/negative`.
30+
- Add integration tests in `tests/` to cover the new patterns.
31+

0 commit comments

Comments
 (0)