A privacy-first, client-side password security toolkit built with Vanilla JavaScript and the Web Crypto API.
Generate strong passwords, analyze password security, create secure passphrases and PINs, inspect entropy and patterns, perform privacy-preserving breach checks, and run security diagnostics — without requiring an application backend.
Your password stays in your browser.
- Cryptographically secure random generation using the Web Crypto API
- Configurable password length
- Uppercase characters
- Lowercase characters
- Numbers
- Symbols
- Character-set validation
- Secure randomness validation
Analyze password characteristics including:
- Password strength
- Entropy
- Character composition
- Length
- Repeated characters
- Sequential patterns
- Common patterns
- Security recommendations
Generate memorable passphrases using configurable word counts.
Generate secure numeric PINs with configurable lengths.
The toolkit supports optional breach checking using the Have I Been Pwned Pwned Passwords range API.
The password is never sent to the breach service.
The process is:
Password
│
▼
SHA-1 hash generated locally
│
▼
First 5 hash characters
│
▼
HIBP range API
│
▼
Returned hash suffixes
│
▼
Exact comparison performed locally
│
▼
Breach result
Security properties:
- Disabled by default
- Requires explicit user consent
- Requires explicit user action
- No password transmission
- No full hash transmission
- Only the first five SHA-1 characters are sent
- Exact comparison occurs locally
- No breach-result persistence
- Requests use
credentials: omit - Requests use
cache: no-store - Response padding is enabled
- Timeout handling is implemented
The application follows a local-first privacy model.
Features include:
- Local-only operation by default
- Automatic clipboard clearing
- Configurable clipboard timeout
- Sensitive-field clearing
- Page-hide cleanup
- No persistent password storage
- No persistent PIN storage
- No persistent passphrase storage
Browser and operating-system clipboard history cannot be guaranteed to be erased by a web application.
The application includes:
- Web App Manifest
- Service Worker
- Offline fallback
- Offline asset caching
- Network-first navigation
- Cache-first static assets
- Installable PWA support
The interface includes accessibility-focused features such as:
- Keyboard interaction
- Accessible controls
- Focus handling
- Status messaging
- Reduced-motion considerations
- Responsive layouts
- Screen-reader-friendly UI structure
The project includes security controls and automated regression tests for:
- XSS
- Sensitive data storage
- Sensitive logging
- Network exfiltration
- Network surface
- CSP
- Cryptographic randomness
- Input validation
- Security configuration
- PWA behavior
- Privacy regressions
┌─────────────────────────────────────────────┐
│ Browser │
│ │
│ ┌─────────────── UI ────────────────────┐ │
│ │ Generator │ Checker │ PIN │ Passphrase│ │
│ │ Privacy │ PWA │ Security │ │
│ └────────────────────────────────────────┘ │
│ │ │
│ ┌────────────── Application Modules ────┐ │
│ │ Generator │ │
│ │ Checker │ │
│ │ Entropy │ │
│ │ Patterns │ │
│ │ Passphrase │ │
│ │ PIN │ │
│ │ Validation │ │
│ │ Privacy │ │
│ │ Security │ │
│ │ Clipboard │ │
│ │ Breach │ │
│ └────────────────────────────────────────┘ │
│ │ │
│ Web Crypto API │
│ │ │
│ ┌────────────┴────────────┐ │
│ │ │ │
│ Local processing Optional breach │
│ range lookup │
└─────────────────────────────────────────────┘
The application is intentionally designed without a custom backend.
The project follows a local-first security architecture.
Random values are generated using the browser's Web Crypto API rather than predictable pseudo-random generation.
Password analysis is performed locally in the browser.
Breach checking is explicitly opt-in.
The application performs:
plaintext password
↓
local SHA-1
↓
40-character hash
↓
5-character prefix
↓
external range query
↓
local suffix comparison
The plaintext password and complete hash are never sent to the breach service.
Normal application functionality is designed to operate locally.
The only intentional external API used by the application is the breach-checking service:
https://api.pwnedpasswords.com
The breach service is accessed only after explicit user action.
The application's security regression tests verify the expected network surface and prevent accidental network calls from being introduced into other modules.
The project uses Vitest for automated testing.
Run the complete test suite:
npm testRun tests once:
npm run test:runRun coverage:
npm run test:coverageRun security tests:
npm run test:securityRun linting:
npm run lintRun the complete release verification:
npm run verify:releaseThe project contains regression tests covering:
Security
├── XSS
├── Storage
├── Logging
├── Network exfiltration
├── Network surface
├── CSP
├── Cryptographic randomness
├── Security configuration
└── Input validation
Privacy
├── Local-only behavior
├── Clipboard handling
├── Sensitive data handling
└── Breach-checking privacy
Application
├── Password generation
├── Password analysis
├── Entropy
├── Patterns
├── Passphrases
├── PINs
└── PWA
Integration
├── Password flow
├── Generator flow
├── Passphrase flow
├── PIN flow
└── Clipboard flow
The project uses enforced coverage thresholds:
| Metric | Minimum |
|---|---|
| Statements | 80% |
| Branches | 75% |
| Functions | 80% |
| Lines | 80% |
Generate a coverage report:
npm run test:coverage| Technology | Purpose |
|---|---|
| HTML5 | Application structure |
| CSS3 | Styling and responsive UI |
| Vanilla JavaScript | Application logic |
| Vite | Development and production build |
| Web Crypto API | Cryptographically secure operations |
| Vitest | Automated testing |
| ESLint | Code quality |
| Service Worker | Offline/PWA functionality |
| Web App Manifest | PWA installation |
| HIBP Pwned Passwords API | Optional breach checking |
pass-tool/
│
├── index.html
├── package.json
├── package-lock.json
├── vite.config.js
├── eslint.config.js
├── CHANGELOG.md
├── README.md
│
├── docs/
│ ├── ARCHITECTURE.md
│ ├── INCIDENT_RESPONSE.md
│ ├── SECURITY.md
│ ├── TESTING.md
│ ├── THREAT_MODEL.md
│ └── deployement/
│ ├── DEPLOYMENT.md
│ └── PRODUCTION_CHECKLIST.md
│
├── public/
│ ├── _headers
│ ├── manifest.webmanifest
│ ├── offline.html
│ ├── sw.js
│ └── icons/
│
├── src/
│ ├── main.js
│ ├── counter.js
│ ├── style.css
│ │
│ ├── modules/
│ │ ├── breach.js
│ │ ├── checker.js
│ │ ├── clipboard.js
│ │ ├── dom-security.js
│ │ ├── entropy.js
│ │ ├── generator.js
│ │ ├── passphrase.js
│ │ ├── patterns.js
│ │ ├── pin.js
│ │ ├── privacy.js
│ │ ├── security.js
│ │ └── validation.js
│ │
│ ├── ui/
│ │ ├── accessibility.js
│ │ ├── breach-ui.js
│ │ ├── notifications.js
│ │ ├── pin-ui.js
│ │ ├── privacy.js
│ │ ├── pwa.js
│ │ ├── security.js
│ │ └── theme.js
│ │
│ └── styles/
│
└── tests/
├── unit/
├── integration/
├── security/
├── statistical/
└── *.test.js
- Node.js
- npm
- Modern browser with Web Crypto API support
Clone the repository:
git clone <YOUR_REPOSITORY_URL>
cd pass-toolInstall dependencies:
npm installStart development server:
npm run devBuild for production:
npm run buildPreview the production build:
npm run previewBefore releasing changes, run:
npm run verify:releaseFor security-specific verification:
npm run test:securityA release should not be considered ready until both pass.
Detailed security documentation is available in:
docs/SECURITY.mddocs/THREAT_MODEL.mddocs/ARCHITECTURE.mddocs/INCIDENT_RESPONSE.mddocs/TESTING.mddocs/deployement/DEPLOYMENT.mddocs/deployement/PRODUCTION_CHECKLIST.md
This project is designed as a privacy-first browser-based security toolkit, but it does not replace a dedicated password manager or enterprise credential-management system.
Important limitations include:
- Browser security ultimately depends on the user's environment.
- Browser extensions can potentially inspect page content.
- A compromised browser or operating system can compromise sensitive information.
- Clipboard clearing cannot guarantee removal from OS/browser clipboard history.
- Breach checking requires an external network request when explicitly enabled.
- SHA-1 is used specifically because it is the format required by the Pwned Passwords range API; it is not being used as a password-storage mechanism.
- No client-side application can guarantee protection against a compromised endpoint.
The project follows these principles:
Sensitive operations should remain local whenever possible.
External communication should require a clear user action.
Only the minimum information required for a feature should leave the browser.
Security-sensitive random generation should use Web Crypto.
Security is implemented through multiple layers:
Input validation
↓
Secure randomness
↓
Local processing
↓
Privacy controls
↓
CSP
↓
Security headers
↓
Automated security tests
↓
Production verification
Security properties are encoded into automated tests so future changes can be checked against the project's security model.
- Password generator
- Password strength analyzer
- Entropy analysis
- Pattern detection
- Passphrase generator
- PIN generator
- Privacy controls
- Accessibility improvements
- PWA/offline support
- Threat model
- Security documentation
- Security regression testing
- Privacy-preserving breach checking
- Network-surface auditing
- CSP network auditing
- Production verification
- Additional password-strength datasets
- More advanced offline analysis
- Expanded browser security diagnostics
- Additional deployment environments
- Security-focused CI/CD pipeline
Contributions are welcome.
Before submitting changes:
npm run lint
npm run test:run
npm run test:coverage
npm run buildSecurity-sensitive changes should also pass:
npm run test:securityPlease avoid introducing:
- unnecessary external network requests
- sensitive logging
- persistent plaintext credentials
- insecure randomness
- unsafe DOM manipulation
- unnecessary third-party dependencies
See the repository license for usage and distribution terms.
Password Security Toolkit
Built as a cybersecurity engineering and privacy-focused portfolio project.
The primary goal is not simply to generate passwords, but to demonstrate how security, privacy, cryptography, browser APIs, testing, threat modeling, and defensive engineering can be combined into a real-world application.