Hardware random number generation using /dev/random, /dev/urandom, and hardware RNG sources. Linux Random Devices /dev/random vs /dev/urandom 1# /dev/random - Blocks when entropy pool is depleted 2# Use for: Long-term cryptographic keys 3 4# /dev/urandom - Never blocks, uses CSPRNG when entropy low 5# Use for: Most โฆ
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 ++ โฆ
Read MoreTools for checking vulnerabilities in Haskell code. Cabal Outdated 1# Check outdated dependencies 2cabal outdated 3 4# Update dependencies 5cabal update 6cabal install --only-dependencies HLint 1# Install 2cabal install hlint 3 4# Run on project 5hlint src/ 6 7# Apply suggestions 8hlint src/ --refactor โฆ
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 = โฆ
Read MoreTools for checking vulnerabilities in Python code. Safety - Dependency Scanner 1# Install 2pip install safety 3 4# Check dependencies 5safety check 6 7# Check requirements file 8safety check -r requirements.txt 9 10# JSON output 11safety check --json Bandit - Static Security Analysis 1# Install 2pip install bandit 3 4# โฆ
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 = โฆ
Read MoreTools for checking vulnerabilities in Rust code. Cargo Audit 1# Install 2cargo install cargo-audit 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 cargo-deny 3 4# Initialize config 5cargo deny init 6 7# Check โฆ
Read MoreSecurity best practices, OWASP Top 10, secure coding practices, and security testing tools. OWASP Top 10 (2021) A01: Broken Access Control Vulnerability 1# โ Insecure Direct Object Reference (IDOR) 2@app.route('/api/users/<user_id>') 3def get_user(user_id): 4 user = db.query(f"SELECT * FROM users โฆ
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