| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Cryptographic Implementation Analyzer
A static analysis tool for detecting weak cryptographic implementations written in Scala, demonstrating functional-OOP hybrid patterns for security code analysis.
NullSec CryptoAudit scans source code to identify weak or deprecated cryptographic algorithms. It detects broken hashes, weak ciphers, insufficient key sizes, and insecure random number generators.
| Algorithm | Type | Status | CWE |
|---|---|---|---|
| MD5 | Hash | Broken | CWE-328 |
| SHA-1 | Hash | Deprecated | CWE-328 |
| DES | Cipher | Broken | CWE-327 |
| 3DES | Cipher | Deprecated | CWE-327 |
| RC4 | Cipher | Broken | CWE-327 |
| RSA-1024 | Asymmetric | Weak | CWE-326 |
| Math.random | PRNG | Weak | CWE-338 |
| PBKDF1 | KDF | Deprecated | CWE-916 |
# Clone the repository
git clone https://github.com/bad-antics/nullsec-cryptoaudit
cd nullsec-cryptoaudit
# Compile with scalac
scalac CryptoAudit.scala
# Run
scala nullsec.cryptoaudit.CryptoAudit
# Or use Ammonite
amm CryptoAudit.scala# Analyze directory
scala CryptoAudit.scala /path/to/code
# Recursive scan
scala CryptoAudit.scala -r project/
# JSON output
scala CryptoAudit.scala -j src/
# Verbose mode
scala CryptoAudit.scala -v app/
# Run demo
scala CryptoAudit.scala╔══════════════════════════════════════════════════════════════════╗
║ NullSec CryptoAudit - Cryptographic Analyzer ║
╚══════════════════════════════════════════════════════════════════╝
[Demo Mode]
Analyzing sample code for weak cryptography...
[CRITICAL] MD5
File: auth.java:45
Code: MessageDigest md = MessageDigest.getInstance("MD5");
Status: Broken
CWE: CWE-328
MITRE: T1110
Fix: Use SHA-256 or SHA-3
[CRITICAL] DES
File: encrypt.js:30
Code: const key = crypto.createCipheriv('des', secret, iv);
Status: Broken
CWE: CWE-327
MITRE: T1573
Fix: Use AES-256
[HIGH] Math.random()
File: random.js:55
Code: const id = Math.random().toString(36);
Status: Weak
CWE: CWE-338
MITRE: T1558
Fix: Use crypto.getRandomValues() or SecureRandom
[MEDIUM] SHA-1
File: crypto.py:120
Code: hash = hashlib.sha1(password.encode())
Status: Deprecated
CWE: CWE-328
MITRE: T1110
Fix: Use SHA-256 or SHA-3
═══════════════════════════════════════════
Summary:
Files Analyzed: 10
Total Findings: 8
Critical: 4
High: 1
Medium: 3
Low: 0
┌─────────────────────────────────────────────────────────────┐
│ Source Code Input │
│ Java | Python | JavaScript | Go | Ruby │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Pattern Matching Engine │
│ Regex patterns for crypto functions │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Algorithm Database Lookup │
│ Status | CWE | MITRE | Recommendation │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Finding Generation │
│ Severity based on algorithm status │
└─────────────────────────────────────────────────────────────┘
case class Algorithm(
name: String,
algType: AlgorithmType,
status: AlgorithmStatus,
keySize: Option[Int],
cwe: String,
recommendation: String
)
case class Finding(
file: String,
line: Int,
code: String,
algorithm: Algorithm,
severity: Severity,
description: String,
mitre: Option[String]
)| Status | Severity | Description |
|---|---|---|
| Broken | Critical | Cryptographically broken |
| Weak | High | Known vulnerabilities |
| Deprecated | Medium | Should not be used |
| Secure | Info | Acceptable algorithms |
This tool is intended for:
Only analyze code you're authorized to review.
MIT License - See LICENSE file for details.
Part of the NullSec Security Toolkit
| Back | FazBrowse Home | New Git URL |