Platform-agnostic cryptographic utility toolkit for ephemeral identity, secure messaging, and portable key management โ built on WebCrypto + noble-curves.
npm install unsea> Platform-agnostic cryptograFor ES modules in the browser:
``html`
bash
Clone and setup
git clone https://github.com/draeder/unsea.git
cd unsea
npm installSetup development environment (configures git hooks, etc.)
npm run ci:setupDevelopment server (for testing in browser)
npm run dev
Opens http://localhost:5173/ with live testing interface
Build the library
npm run buildRun examples and tests
npm run example
npm testSecurity audit
npm run security:audit
`$3
This project uses a comprehensive CI/CD pipeline to ensure code quality and security:
- ๐ Automated Security Scanning: Every commit is scanned for vulnerabilities
- ๐งช Multi-Platform Testing: Tests run on Linux, Windows, and macOS
- ๐ Browser Compatibility: Automated browser testing with multiple engines
- ๐ฆ Package Integrity: Validates package installation and imports
- ๐ฆ Pre-commit Hooks: Local validation before commits
- ๐ฅ Required Reviews: All changes must be reviewed before merging
See CI/CD Documentation for detailed information.
---ity toolkit for ephemeral identity, secure messaging, and portable key management โ built on WebCrypto + noble-curves.
๐ Features
- ๐ Deterministic or random P-256 keypair generation
- โ๏ธ Message signing and verification (ECDSA)
- ๐ Message encryption and decryption (ECDH + AES-GCM)
- ๐ฆ Encrypted message metadata: sender pubkey and timestamp
- ๐ Export/import keys to JWK and PEM formats (PKCS#8 compliant)
- ๐พ Encrypted IndexedDB persistence with password protection
- โ๏ธ Proof-of-work generation and verification (SHA-256 based mining)
- ๐ Signed proof-of-work with cryptographic attestation
- ๐ก๏ธ Enhanced security: input validation, constant-time operations, proper error handling
- ๐ฆ Bundled with Vite for optimal performance and security
- โ๏ธ Multiple formats: ES modules (.mjs), CommonJS (.cjs), and UMD (.js) for maximum compatibility
- ๐ Cross-platform: Works seamlessly in Node.js and modern browsers
---
๐ฆ Installation
`bash
npm install unsea
`Or use directly in the browser via CDN:
`html
`For ES modules in the browser:
`html
`---
๏ฟฝ Build Architecture
Unsea uses Vite for modern bundling with multiple output formats:
| Format | File | Environment | Usage |
|--------|------|-------------|-------|
| ES Modules |
dist/unsea.mjs | Modern Node.js, browsers | import * as unsea from 'unsea' |
| CommonJS | dist/unsea.cjs | Traditional Node.js | const unsea = require('unsea') |
| UMD | dist/unsea.umd.js | Browsers (global) |