Thank you for your interest in contributing to Crypto Scan! This project is part of the QRAMM toolkit by CSNP, and we welcome contributions from the community.
By participating in this project, you agree to maintain a respectful and inclusive environment for everyone.
- Check if the issue already exists in GitHub Issues
- If not, create a new issue with:
- Clear, descriptive title
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Go version)
- Sample code or files if applicable
Open an issue with the enhancement label describing:
- The problem you're trying to solve
- Your proposed solution
- Any alternatives you've considered
-
Fork the repository
-
Create a branch
git checkout -b feature/your-feature-name
-
Make your changes
- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed
-
Run tests
go test -race ./... -
Commit with clear messages
git commit -m "Add: description of what you added" git commit -m "Fix: description of what you fixed" git commit -m "Update: description of what you changed"
-
Push and create PR
git push origin feature/your-feature-name
- Go 1.21 or later
- Git
git clone https://github.com/csnp/cryptoscan.git
cd cryptoscan
go build -o cryptoscan ./cmd/cryptoscan# All tests
go test ./...
# With race detection
go test -race ./...
# With coverage
go test -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out├── cmd/cryptoscan/ # CLI entry point
├── internal/cli/ # CLI commands
├── pkg/
│ ├── analyzer/ # File and context analysis
│ ├── patterns/ # Crypto pattern definitions
│ ├── reporter/ # Output formatters
│ ├── scanner/ # Core scanning logic
│ └── types/ # Shared types
To add new cryptographic detection patterns:
-
Edit
pkg/patterns/matcher.go -
Add a new
Patternstruct with:- Unique ID (e.g., "RSA-001")
- Descriptive name
- Category
- Compiled regex
- Severity level
- Quantum risk classification
- Description and remediation guidance
-
Add tests in
pkg/patterns/matcher_test.go
Example:
{
ID: "NEW-001",
Name: "New Pattern Name",
Category: "Category Name",
Regex: regexp.MustCompile(`your-regex-here`),
Severity: types.SeverityHigh,
Quantum: types.QuantumVulnerable,
Algorithm: "AlgorithmName",
Description: "What this pattern detects",
Remediation: "How to fix it",
}- Follow standard Go conventions
- Use
gofmtfor formatting - Keep functions focused and small
- Add comments for exported functions
- Prefer clarity over cleverness
- Write table-driven tests where appropriate
- Test both positive and negative cases
- Include edge cases
- Aim for meaningful coverage, not just percentage
- Open an issue for questions
- Join discussions in existing issues
- Reach out via CSNP
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.