# device-fingerprint
[](https://crates.io/crates/device-fingerprint)
[](https://docs.rs/device-fingerprint)
[](https://opensource.org/licenses/MIT)
Generate a unique device fingerprint by collecting hardware identifiers from Windows devices.
## Features
- **No Admin Rights Required** - All collection methods work without elevated privileges
- **Pure Windows API** - Uses only `windows-sys` for native API calls, with optional WMIC support
- **Stable & Reliable** - Generates fingerprints based on Machine GUID and CPU characteristics
- **SHA256 Output** - Produces a standard 64-character hash value
## Installation
Add the dependency to your `Cargo.toml`:
```toml
[dependencies]
device-fingerprint = "0.1.1"
```
## Quick Start
```rust
use device_fingerprint::{generate, verify};
fn main() {
// Generate device fingerprint
let fingerprint = generate();
println!("Device Fingerprint: {}", fingerprint);
// Verify device fingerprint
if verify(&fingerprint) {
println!("Fingerprint verification passed");
}
}
```
## API Documentation
### Main Functions
| `generate()` | Generate device fingerprint, returns 64-character SHA256 hash |
| `verify(expected)` | Verify if the fingerprint matches the current device |
### Collector Module
| `collectors::machine_guid()` | Get Windows Machine GUID |
| `collectors::cpu_id()` | Get CPU vendor and feature information |
| `collectors::wmic_uuid()` | (Optional) Get SMBIOS UUID via WMI |
## Collected Information
| Machine GUID | Registry `HKLM\SOFTWARE\Microsoft\Cryptography` | Changes after OS reinstall |
| CPU ID | CPUID instruction | Changes after CPU replacement |
## Use Cases
Use this library in scenarios where client-side feature modification is restricted, enabling:
- Software license binding
- Device authentication
## System Requirements
- Windows 7 and above
- x86 / x86_64 architecture
## License
MIT