Hardware random number generation using /dev/random, /dev/urandom, and hardware RNG sources. Linux Random Devices /dev/random vs /dev/urandom 1# /dev/random - Since Linux 5.6 blocks only until the CRNG is initialised at boot 2# Use for: Long-term cryptographic keys 3 4# /dev/urandom - Never blocks (same CRNG; before …
Read MoreHardware security features: TPM, Secure Boot, hardware encryption, and security best practices. TPM (Trusted Platform Module) Check TPM Status (Linux) 1# Check if TPM exists 2ls /dev/tpm* 3 4# TPM version 5cat /sys/class/tpm/tpm0/tpm_version_major 6 7# TPM info 8sudo tpm2_getcap properties-fixed 9 10# Install TPM tools …
Read MoreSecure coding practices for Haskell applications. SQL Injection Prevention 1-- ❌ Vulnerable 2import Database.PostgreSQL.Simple 3getUserBad :: Connection -> String -> IO [User] 4getUserBad conn username = 5 query_ conn $ fromString $ "SELECT * FROM users WHERE username = '" ++ username ++ "'" 6 7-- ✅ Secure: …
Read MoreTools for checking vulnerabilities in Haskell code. Cabal Outdated 1# Check outdated dependencies (version drift only — no advisory database) 2cabal outdated 3 4# Check against the Haskell security advisories 5cabal-audit HLint 1# Install 2cabal install hlint 3 4# Run on project 5hlint src/ 6 7# Apply suggestions …
Read MoreSecure coding practices for Python applications. SQL Injection Prevention 1# ❌ Vulnerable 2user_input = request.GET['username'] 3query = f"SELECT * FROM users WHERE username = '{user_input}'" 4cursor.execute(query) 5 6# ✅ Secure: Parameterized queries 7user_input = request.GET['username'] 8query = "SELECT * FROM users …
Read MoreTools for checking vulnerabilities in Python code. Safety - Dependency Scanner 1# Install 2pip install safety 3 4# Scan the project (Safety 3+:
safety checkis deprecated; 5#safety scanneeds a free Safety account —safety auth login) 6safety scan 7 8# No account? Use pip-audit (below): pip-audit -r …
Read MoreSecure coding practices for Rust applications. SQL Injection Prevention 1// ❌ Vulnerable 2let username = req.param("username"); 3let query = format!("SELECT * FROM users WHERE username = '{}'", username); 4conn.query(&query); 5 6// ✅ Secure (using sqlx) 7let username = req.param("username"); 8let user = …
Read MoreTools for checking vulnerabilities in Rust code. Cargo Audit 1# Install (the
fixsubcommand needs the feature) 2cargo install cargo-audit --features=fix 3 4# Check vulnerabilities 5cargo audit 6 7# Fix vulnerabilities 8cargo audit fix 9 10# JSON output 11cargo audit --json Cargo Deny 1# Install 2cargo install …
Read MoreSecurity best practices, OWASP Top 10, secure coding practices, and security testing tools. OWASP Top 10 (2021; superseded by the 2025 edition) graph TD A[OWASP Top 10] --> B[A01: Broken Access Control] A --> C[A02: Cryptographic Failures] A --> D[A03: Injection] A --> E[A04: Insecure Design] A --> F[A05: Security …
Read MoreSecure coding practices for TypeScript applications. XSS Prevention 1// ❌ Vulnerable 2function displayMessage(message: string) { 3 document.getElementById('output')!.innerHTML = message; 4} 5 6// ✅ Secure 7function displayMessage(message: string) { 8 const element = document.getElementById('output')!; 9 …
Read MoreTools for checking vulnerabilities in TypeScript/JavaScript code. npm audit 1# Check vulnerabilities 2npm audit 3 4# Fix automatically 5npm audit fix 6 7# Force fix (may break) 8npm audit fix --force 9 10# JSON output 11npm audit --json Snyk 1# Install 2npm install -g snyk 3 4# Authenticate 5snyk auth 6 7# Test project …
Read MoreWireGuard VPN setup with port forwarding and tunneling. Modern, fast, and secure VPN solution. Installation 1# Linux (Ubuntu/Debian) 2sudo apt update 3sudo apt install wireguard 4 5# Linux (Fedora/RHEL) 6sudo dnf install wireguard-tools 7 8# macOS 9brew install wireguard-tools 10 11# Windows 12# Download from …
Read More