A browser fingerprinting demo that collects various browser characteristics to generate a unique device fingerprint. Built with Rust compiled to WebAssembly for performance and security.
Browser fingerprinting is a technique that collects information about a web browser's configuration and capabilities to create a unique identifier. This project demonstrates how various browser attributes can be combined to create a surprisingly unique fingerprint.
| Category | Data Points |
|---|---|
| Browser | User Agent, Language, Platform, Cookies, Do Not Track |
| Hardware | CPU Cores, Device Memory, Touch Points |
| Display | Screen Resolution, Color Depth, Pixel Ratio |
| Timezone | Timezone Name, UTC Offset |
| Storage | LocalStorage, SessionStorage, IndexedDB |
| Canvas | Canvas 2D Fingerprint (rendered graphics hash) |
| WebGL | Vendor, Renderer, Version, Extensions |
| Plugins | Browser Plugins and MIME Types |
Install wasm-pack:
cargo install wasm-pack# Build the WebAssembly module
wasm-pack build --target web
# Or use the build script
./build.shYou need to serve the files from a web server (required for ES modules):
# Using Python
python3 -m http.server 8080
# Or using Node.js (install serve globally first: npm install -g serve)
serve .
# Or use any other static file serverThen open http://localhost:8080/www in your browser.
.
├── Cargo.toml # Rust dependencies
├── src/
│ └── lib.rs # Rust fingerprinting library
├── www/
│ ├── index.html # Main HTML page
│ ├── style.css # Cyberpunk-themed styles
│ └── index.js # JavaScript to interact with WASM
├── pkg/ # Generated WASM package (after build)
└── README.md
-
Rust Library (
src/lib.rs): Contains all the fingerprinting logic. Collects browser information using web-sys bindings to JavaScript APIs. -
WebAssembly: The Rust code is compiled to WASM using wasm-pack, creating a portable binary that runs in any modern browser.
-
Frontend: A modern, cyberpunk-themed UI that displays all collected fingerprint data and the final hash.
This is a demonstration project for educational purposes. All fingerprinting is performed locally in your browser - no data is sent to any server.
Browser fingerprinting can be used for:
- ✅ Fraud detection
- ✅ Bot detection
- ✅ Security research
⚠️ User tracking (use responsibly)
The final fingerprint hash is generated by combining all collected data points and hashing them with SHA-256. This creates a unique identifier that can be used to recognize the same browser configuration across sessions.
# Build in development mode (faster compilation)
wasm-pack build --target web --dev
# Build for production (optimized)
wasm-pack build --target web --releasewasm-bindgen- Rust/JS interopweb-sys- Web API bindingsjs-sys- JavaScript API bindingsserde- Serializationsha2- SHA-256 hashinghex- Hex encodingrust_code_obfuscator- Compile-time string obfuscationcryptify- Encryption primitives for obfuscation
This project uses rust_code_obfuscator to encrypt sensitive string literals at compile-time. This makes reverse engineering the WASM binary more difficult by:
- Encrypting API property names (like
cookieEnabled,deviceMemory) - Obfuscating WebGL extension names
- Hiding fingerprinting-related strings
The strings are decrypted at runtime, so functionality remains unchanged.
MIT License - feel free to use this for learning and experimentation.
- Rust and WebAssembly Working Group
- wasm-bindgen
- FingerprintJS for inspiration