{"_id":"@codecot/pw-checker","_rev":"2-4d66fc668e778d149f91fed6459e15a9","name":"@codecot/pw-checker","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@codecot/pw-checker","version":"1.0.0","keywords":["password","security","audit","hibp","breach","chrome","bitwarden","cli","cybersecurity"],"author":{"name":"Volodymyr Pasichnyk","email":"volodymyr.pasichnyk@gmail.com"},"license":"MIT","_id":"@codecot/pw-checker@1.0.0","maintainers":[{"name":"pasechnik","email":"vladimir.pasechnik@gmail.com"}],"homepage":"https://github.com/codecot/pw-checker","bugs":{"url":"https://github.com/codecot/pw-checker/issues"},"bin":{"pw-checker":"bin/pw-checker.js"},"dist":{"shasum":"e96cf1552014399ce460e603c254b1c00c91bff1","tarball":"https://registry.npmjs.org/@codecot/pw-checker/-/pw-checker-1.0.0.tgz","fileCount":57,"integrity":"sha512-B2mGJoXtRZuDp0S5myMt/h8zOFguzOpnWdfuKDG1j4yzB6ggCHDkXkPC9deQ7FmhMK1UzpSX6/dHfEFdvOuq1Q==","signatures":[{"sig":"MEYCIQCrbUNaf+pYO0hv1q9ZpXwLCZ4VI76Gxwgb0O4LNenb8gIhAPAJpRdZa9eF/hkALU5Fpd88TPE2LjagA0oKaz6qbVUU","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":230035},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"842a109da3b066e94d2d47b6e1dec8cb77cd3c7f","scripts":{"cli":"node bin/pw-checker.js","dev":"NODE_OPTIONS=\"--import tsx\" node src/index.ts","help":"NODE_OPTIONS=\"--import tsx\" node src/index.ts --help","test":"echo \"Error: no test specified\" && exit 1","view":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts","build":"tsc","start":"NODE_OPTIONS=\"--import tsx\" node src/index.ts","format":"prettier --write \"src/**/*.ts\"","health":"NODE_OPTIONS=\"--import tsx\" node src/healthCheck.ts","clear:db":"NODE_OPTIONS=\"--import tsx\" node src/clearDb.ts","prebuild":"rm -rf dist","risk:all":"NODE_OPTIONS=\"--import tsx\" node src/riskAnalysis.ts --all","risk:show":"NODE_OPTIONS=\"--import tsx\" node src/riskAnalysis.ts --show-risks","view:safe":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --safe","postinstall":"node -e \"try { require('fs').mkdirSync('db', { recursive: true }); require('fs').mkdirSync('reports', { recursive: true }); } catch (e) {}\"","risk:report":"NODE_OPTIONS=\"--import tsx\" node src/riskAnalysis.ts --generate-pdf","view:chrome":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --chrome","format:check":"prettier --check \"src/**/*.ts\"","import:chrome":"NODE_OPTIONS=\"--import tsx\" node src/index.ts --chrome","update:schema":"NODE_OPTIONS=\"--import tsx\" node src/updateDbSchema.ts","view:breached":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --breached","check:breaches":"NODE_OPTIONS=\"--import tsx\" node src/index.ts --check-breaches","prepublishOnly":"npm run build","risk:calculate":"NODE_OPTIONS=\"--import tsx\" node src/riskAnalysis.ts --calculate-risk","security:setup":"bash scripts/setup-security.sh","view:high-risk":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --high-risk","view:unchecked":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --unchecked","analyze:breaches":"NODE_OPTIONS=\"--import tsx\" node src/breachAnalysis.ts","import:bitwarden":"NODE_OPTIONS=\"--import tsx\" node src/importFromBitwarden.ts","view:compromised":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --compromised","import:chrome-csv":"NODE_OPTIONS=\"--import tsx\" node src/index.ts --chrome-csv","view:critical-risk":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --critical-risk","check:breaches:stats":"NODE_OPTIONS=\"--import tsx\" node src/index.ts --breach-stats","check:breaches:resume":"NODE_OPTIONS=\"--import tsx\" node src/index.ts --check-breaches --resume","import:bitwarden:help":"NODE_OPTIONS=\"--import tsx\" node src/importFromBitwarden.ts --help","view:breached:detailed":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --breached-detailed","view:chrome-compromised":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --chrome-compromised","check:breaches:scheduled":"NODE_OPTIONS=\"--import tsx\" node src/index.ts --breach-scheduled"},"_npmUser":{"name":"pasechnik","email":"vladimir.pasechnik@gmail.com"},"repository":{"url":"git+https://github.com/codecot/pw-checker.git","type":"git"},"_npmVersion":"10.8.2","description":"A comprehensive CLI tool to audit passwords locally using HIBP and import from Chrome/Bitwarden","directories":{},"_nodeVersion":"20.19.2","dependencies":{"chalk":"^5.4.1","jspdf":"^3.0.1","dotenv":"^16.5.0","sqlite":"^5.1.1","sqlite3":"^5.1.7","csv-parser":"^3.2.0","node-fetch":"^3.3.2"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.4","ts-node":"^10.9.2","prettier":"^3.5.3","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/pw-checker_1.0.0_1748754507495_0.24930735083598732","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@codecot/pw-checker","version":"1.1.0","description":"A comprehensive CLI tool to audit passwords locally using HIBP and import from Chrome/Bitwarden","type":"module","main":"dist/index.js","bin":{"pw-checker":"bin/pw-checker.js"},"engines":{"node":">=18.0.0"},"scripts":{"help":"NODE_OPTIONS=\"--import tsx\" node src/index.ts --help","health":"NODE_OPTIONS=\"--import tsx\" node src/healthCheck.ts","security:setup":"bash scripts/setup-security.sh","build":"tsc","prebuild":"rm -rf dist","prepublishOnly":"npm run build","postinstall":"node -e \"try { require('fs').mkdirSync('db', { recursive: true }); require('fs').mkdirSync('reports', { recursive: true }); } catch (e) {}\"","test":"echo \"Error: no test specified\" && exit 1","dev":"NODE_OPTIONS=\"--import tsx\" node src/index.ts","cli":"node bin/pw-checker.js","view":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts","view:compromised":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --compromised","view:safe":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --safe","view:unchecked":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --unchecked","view:breached":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --breached","view:breached:detailed":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --breached-detailed","analyze:breaches":"NODE_OPTIONS=\"--import tsx\" node src/breachAnalysis.ts","view:chrome":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --chrome","view:chrome-compromised":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --chrome-compromised","start":"NODE_OPTIONS=\"--import tsx\" node src/index.ts","import:chrome":"NODE_OPTIONS=\"--import tsx\" node src/index.ts --chrome","import:chrome-csv":"NODE_OPTIONS=\"--import tsx\" node src/index.ts --chrome-csv","import:bitwarden":"NODE_OPTIONS=\"--import tsx\" node src/importFromBitwarden.ts","import:bitwarden:help":"NODE_OPTIONS=\"--import tsx\" node src/importFromBitwarden.ts --help","check:breaches":"NODE_OPTIONS=\"--import tsx\" node src/index.ts --check-breaches","check:breaches:resume":"NODE_OPTIONS=\"--import tsx\" node src/index.ts --check-breaches --resume","check:breaches:stats":"NODE_OPTIONS=\"--import tsx\" node src/index.ts --breach-stats","check:breaches:scheduled":"NODE_OPTIONS=\"--import tsx\" node src/index.ts --breach-scheduled","clear:db":"NODE_OPTIONS=\"--import tsx\" node src/clearDb.ts","update:schema":"NODE_OPTIONS=\"--import tsx\" node src/updateDbSchema.ts","risk:calculate":"NODE_OPTIONS=\"--import tsx\" node src/riskAnalysis.ts --calculate-risk","risk:show":"NODE_OPTIONS=\"--import tsx\" node src/riskAnalysis.ts --show-risks","risk:report":"NODE_OPTIONS=\"--import tsx\" node src/riskAnalysis.ts --generate-pdf","risk:all":"NODE_OPTIONS=\"--import tsx\" node src/riskAnalysis.ts --all","view:high-risk":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --high-risk","view:critical-risk":"NODE_OPTIONS=\"--import tsx\" node src/queryDb.ts --critical-risk","format":"prettier --write \"src/**/*.ts\"","format:check":"prettier --check \"src/**/*.ts\""},"keywords":["password","security","audit","hibp","breach","chrome","bitwarden","cli","cybersecurity"],"author":{"name":"Volodymyr Pasichnyk","email":"volodymyr.pasichnyk@gmail.com"},"license":"MIT","homepage":"https://github.com/codecot/pw-checker","repository":{"type":"git","url":"git+https://github.com/codecot/pw-checker.git"},"bugs":{"url":"https://github.com/codecot/pw-checker/issues"},"dependencies":{"chalk":"^5.4.1","csv-parser":"^3.2.0","dotenv":"^16.5.0","jspdf":"^3.0.1","node-fetch":"^3.3.2","sqlite":"^5.1.1","sqlite3":"^5.1.7"},"devDependencies":{"prettier":"^3.5.3","ts-node":"^10.9.2","tsx":"^4.19.4","typescript":"^5.8.3"},"_id":"@codecot/pw-checker@1.1.0","gitHead":"842a109da3b066e94d2d47b6e1dec8cb77cd3c7f","types":"./dist/index.d.ts","_nodeVersion":"20.19.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-iBI2f9HmpR2jtGbjiuum2lo9kjTXZOqkr/2W/bXCrC7do+UUX/bIu/Li6JGTfhV4yZIRy5Hvkn3/OoigEZlckw==","shasum":"56f8046aa38aaeba186718cfed68626fc9ed345c","tarball":"https://registry.npmjs.org/@codecot/pw-checker/-/pw-checker-1.1.0.tgz","fileCount":57,"unpackedSize":230930,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBW77P+ySWuEtryuuDdP8PVmuKCJ/JLFtWchedQDsAZfAiEAoV8OdxMRw3ZGrpemdiC8ggkhOpTB0PGHAU5bW5MO1g8="}]},"_npmUser":{"name":"pasechnik","email":"vladimir.pasechnik@gmail.com"},"directories":{},"maintainers":[{"name":"pasechnik","email":"vladimir.pasechnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pw-checker_1.1.0_1748754987006_0.34881374324531733"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-01T05:08:27.414Z","modified":"2025-06-01T05:16:27.402Z","1.0.0":"2025-06-01T05:08:27.700Z","1.1.0":"2025-06-01T05:16:27.205Z"},"bugs":{"url":"https://github.com/codecot/pw-checker/issues"},"author":{"name":"Volodymyr Pasichnyk","email":"volodymyr.pasichnyk@gmail.com"},"license":"MIT","homepage":"https://github.com/codecot/pw-checker","keywords":["password","security","audit","hibp","breach","chrome","bitwarden","cli","cybersecurity"],"repository":{"type":"git","url":"git+https://github.com/codecot/pw-checker.git"},"description":"A comprehensive CLI tool to audit passwords locally using HIBP and import from Chrome/Bitwarden","maintainers":[{"name":"pasechnik","email":"vladimir.pasechnik@gmail.com"}],"readme":"# Password Checker\n\n🔐 A local CLI tool that helps you audit saved passwords for security breaches using the Have I Been Pwned (HIBP) API and optional Chrome password database analysis. All data remains local — privacy first.\n\n## Overview\n\nThis tool allows you to check if your passwords have been compromised in data breaches without sending your actual passwords to any external service. It does this by:\n\n1. Importing passwords from CSV files or Chrome\n2. Checking them against the HIBP database using the k-anonymity model (only sending first 5 characters of the password hash)\n3. Storing results in a local SQLite database for easy review\n\n## Features\n\n### ✅ Current Features\n\n| Feature | Status |\n| ------- | ------ |\n| CSV import → SQLite | ✅ Done (importCsv.ts) |\n| HIBP password check | ✅ Done (checkPasswords.ts) |\n| SQLite database setup | ✅ Done (pw_entries table) |\n| Terminal viewer with filters | ✅ Done (queryDb.ts) |\n| Modern TypeScript + ES Modules | ✅ Done |\n| Chrome DB import | ✅ Done (importFromChrome.ts) |\n| Chrome CSV export import | ✅ Done (importFromChromeCsv.ts) |\n| Account breach checking | ✅ Done (checkBreaches.ts) |\n| Code formatting with Prettier | ✅ Done |\n| MIT License & GitHub repo | ✅ Done |\n\n### 📋 Planned Features\n\n| Goal | Description |\n| ---- | ----------- |\n| 📊 Password strength analysis | Use zxcvbn or OWASP to score each password |\n| 🏷 Credential categorization | Mark entries like bank, email, work, etc. |\n| 🖼 Logo/visual enrichment | Pull site logos via Clearbit API |\n| 🔐 Bitwarden CLI integration | Import/export from Bitwarden (bw) |\n| 🌐 Web UI dashboard | React frontend + Fastify/Express backend |\n\n## Requirements\n\n- Node.js 18+\n- npm or yarn\n\n## Installation\n\n### NPM Global Installation\n\n```bash\n# Install globally\nnpm install -g @codecot/pw-checker\n\n# Run the tool\npw-checker --help\n```\n\n### Direct Usage with npx\n\n```bash\n# Run without installing\nnpx @codecot/pw-checker --help\n```\n\n### Manual Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/codecot/pw-checker.git\ncd pw-checker\n\n# Install dependencies\nnpm install\n\n# Verify installation\nnpm run health\n\n# Show help\nnpm run help\n```\n\n## Quick Start\n\n```bash\n# Set up secure password file structure\nnpm run security:setup\n\n# Copy the example file (do not commit your actual passwords!)\ncp data/passwords.csv.template data/passwords.csv\n\n# Run the application in development mode (limits API calls)\nnpm start -- --dev\n\n# View results\nnpm run view\n```\n\n## 🔒 Security & Privacy\n\n**Your data stays local** - passwords never leave your machine:\n\n- All processing happens locally in SQLite\n- Only password hash prefixes (5 chars) are sent to HIBP API\n- CSV files containing real passwords are never committed to Git\n- Comprehensive `.gitignore` protects sensitive files\n\n### Security Setup\n\n```bash\n# Automated security setup\nnpm run security:setup\n\n# Manual verification\ngit check-ignore data/passwords.csv data/chrome-passwords.csv\n```\n\n## 🚀 Rate Limiting & API Optimization\n\nFor HIBP breach checking, pw-checker implements intelligent rate limiting and optimization:\n\n### Key Features\n\n- **Email Deduplication**: Only checks each unique email once (can reduce API calls by 80%+)\n- **Batch Processing**: Respects 10 req/min API limits with smart batching\n- **Resume Capability**: Continue interrupted checks from where you left off\n- **Progress Tracking**: Detailed statistics and ETA estimates\n- **Cron-Friendly**: Scheduled mode for automated processing\n- **Incremental Processing**: Each API call intelligently updates all database entries sharing the same email address\n\n### Rate Limiting Configuration\n\nThe tool automatically handles HIBP API rate limits:\n\n- **Pwned 1 Tier**: 10 requests/minute (default configuration)\n- Batches of 8 accounts with 7-second delays between requests\n- 70-second delays between batches to prevent rate limit violations\n\n### Example Workflow\n\n```bash\n# Check current progress\nnpm run check:breaches:stats\n\n# Start or resume breach checking\nnpm run check:breaches\nnpm run check:breaches:resume\n\n# For large datasets: set up automated processing\n# This processes small batches every 10 minutes\ncrontab -e\n# Add: */10 * * * * /path/to/scripts/cron-breach-check.sh\n```\n\n**Read our comprehensive guides:**\n\n- [`docs/HIBP_API_SETUP.md`](docs/HIBP_API_SETUP.md) - API key setup\n- [`docs/RATE_LIMITING.md`](docs/RATE_LIMITING.md) - Detailed rate limiting guide\n- [`docs/ADVANCED_FEATURES.md`](docs/ADVANCED_FEATURES.md) - Complete guide to advanced features\n\n### Available Commands\n\n**Core Commands:**\n\n- `npm run help` - Show detailed help information\n- `npm run health` - Run system health check  \n- `npm run security:setup` - Set up secure password file structure\n- `npm start` - Import CSV and check passwords (full mode)\n- `npm start -- --dev` - Development mode (limits API calls to 5 records)\n- `npm start -- --skip-network` - Skip all network API calls\n\n**Import Commands:**\n\n- `npm run import:chrome` - Import passwords from Chrome database\n- `npm run import:chrome-csv` - Import passwords from Chrome CSV export\n\n**Breach Checking Commands:**\n\n- `npm run check:breaches` - Check email accounts for data breaches (requires HIBP API key)\n- `npm run check:breaches:stats` - Show breach check progress and statistics\n- `npm run check:breaches:resume` - Resume interrupted breach checks\n- `npm run check:breaches:scheduled` - Run single batch for cron jobs (rate limit friendly)\n\n**View Commands:**\n\n- `npm run view` - View all passwords and their status\n- `npm run view:compromised` - View only compromised passwords\n- `npm run view:safe` - View only safe passwords\n- `npm run view:unchecked` - View only unchecked passwords\n- `npm run view:breached` - View only accounts found in data breaches\n- `npm run view:breached:detailed` - View detailed breach information with descriptions and affected data\n- `npm run view:chrome` - View only Chrome-imported entries\n- `npm run view:chrome-compromised` - View only Chrome entries marked as compromised\n\n**Analysis Commands:**\n\n- `npm run analyze:breaches` - Comprehensive breach analysis with recent breaches, multi-account impacts, and domain statistics\n\n**Utility Commands:**\n\n- `npm run clear:db` - Clear the database\n- `npm run format` - Format code using Prettier\n\n**Read our comprehensive security guide:** [`docs/SECURITY.md`](docs/SECURITY.md)\n\n## Project Structure\n\n```text\npw-checker/\n├── src/\n│   ├── index.ts             # Entry point\n│   ├── importCsv.ts         # CSV → SQLite\n│   ├── importFromChrome.ts  # Chrome DB → SQLite\n│   ├── importFromChromeCsv.ts # Chrome CSV → SQLite\n│   ├── checkPasswords.ts    # HIBP verification\n│   ├── checkBreaches.ts     # Account breach checking\n│   ├── queryDb.ts           # View data\n│   ├── clearDb.ts           # Clear database\n│   ├── healthCheck.ts       # System health verification\n│   └── database.ts          # Shared database utilities\n├── data/\n│   ├── passwords.csv        # Your password data (NEVER COMMITTED)\n│   ├── chrome-passwords.csv # Chrome CSV export (NEVER COMMITTED)\n│   ├── passwords.csv.template      # Template for CSV passwords\n│   └── chrome-passwords.csv.template # Template for Chrome CSV export\n├── db/\n│   └── pw_entries.sqlite    # Local database (NEVER COMMITTED)\n├── docs/\n│   └── SECURITY.md          # Comprehensive security guide\n├── scripts/\n│   └── setup-security.sh    # Automated security setup\n├── package.json\n├── tsconfig.json\n├── .prettierrc              # Prettier configuration\n├── LICENSE (MIT)\n├── README.md\n├── CONTRIBUTING.md\n└── .gitignore               # Protects sensitive files\n```\n\n## License\n\nMIT\n\n## Author\n\nVolodymyr Pasichnyk <volodymyr.pasichnyk@gmail.com>\n","readmeFilename":"README.md"}