| layout | default |
|---|---|
| title | FAQ |
Common questions about the Device Fingerprinting Library.
Device fingerprinting is the process of generating a unique, stable identifier for a computing device based on its hardware characteristics. Unlike traditional identifiers such as IP addresses or cookies, device fingerprints:
- Persist across reboots and reinstalls
- Are derived from immutable hardware properties
- Work without network connectivity
- Are difficult to spoof or manipulate
| Aspect | Device Fingerprinting | MAC Address | Serial Number |
|---|---|---|---|
| Uniqueness | Very high | High | High |
| Stability | Across OS/hardware changes | Changes with NIC replacement | Doesn't change |
| Accessibility | Application-level | Network-level | Hardware-specific |
| Spoofability | Difficult | Easy (spoofing tools) | Very difficult |
| Privacy | Respects anonymity | Network-visible | Hardware-visible |
| Cross-platform | Yes | OS-specific | Hardware-specific |
Ideal use cases include:
- Software Licensing: Bind licenses to specific devices
- Account Security: Detect logins from unknown devices
- Fraud Prevention: Identify suspicious activities
- Device Management: Track and manage company devices
- API Security: Bind API tokens to devices
- Cloud Security: Enforce device-based access control
- Windows: 7, 8, 10, 11
- macOS: 10.13+, including Apple Silicon (M1/M2/M3)
- Linux: Ubuntu 16.04+, CentOS 7+, Debian 9+, and most modern distributions
- Python 3.9
- Python 3.10
- Python 3.11
- Python 3.12
Python 3.8 and earlier are not supported.
Solutions:
Option 1: Use --user flag to install for current user only:
pip install --user device-fingerprinting-proOption 2: Use a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install device-fingerprinting-proOption 3: Use sudo (Linux/macOS only):
sudo pip install device-fingerprinting-proCauses: Missing C++ compiler or development headers
Solutions:
Windows:
- Download Microsoft C++ Build Tools
- Install from: https://visualstudio.microsoft.com/visual-cpp-build-tools/
- Retry installation
Linux (Ubuntu/Debian):
sudo apt-get install -y python3-dev build-essential
pip install device-fingerprinting-proLinux (CentOS/RHEL):
sudo yum groupinstall -y "Development Tools"
sudo yum install -y python3-devel
pip install device-fingerprinting-promacOS:
xcode-select --install
pip install device-fingerprinting-proCauses: Wrong Python interpreter or virtual environment not activated
Solutions:
-
Verify installation:
pip show device-fingerprinting-pro
-
Check Python version:
python --version # Must be 3.9+ -
Verify environment:
which python # Should show venv path if activated -
Try explicit installation:
python -m pip install device-fingerprinting-pro
For TPM support:
pip install device-fingerprinting-pro[tpm]For post-quantum cryptography:
pip install device-fingerprinting-pro[pqc]For all features:
pip install device-fingerprinting-pro[all]This should not happen. Device fingerprints are deterministic and should be identical.
If fingerprints differ:
-
Check for hardware changes: New disk, network adapter, or BIOS update
-
Check system state: Was the system hibernating, suspended, or using clone mode?
-
Enable debug mode:
generator = DeviceFingerprintGenerator() result = generator.generate_fingerprint(include_debug_info=True) print(result.components)
-
Compare components: Check if hardware list changed between runs
Typical timings:
| Method | Speed |
|---|---|
| Basic | ~50ms |
| Advanced | ~100-150ms |
| Quantum-Resistant | ~200-300ms |
If generation is slow:
- Check system load (CPU usage)
- Check disk speed (SSDs are faster)
- Use Basic method for real-time applications
It's very difficult to generate the same fingerprint on different hardware because:
- Hardware identifiers are from immutable components
- TPM provides hardware-backed verification
- Multiple methods provide redundancy
- Device binding prevents reuse
However, on the same device, fingerprints can be obtained. Always combine with:
- Encryption and key management
- Multi-factor authentication
- Anomaly detection
- Regular verification
Secure storage options:
Option 1: OS Keyring (Recommended)
generator.store_fingerprint("my_fingerprint", fingerprint)Option 2: Encrypted database
# Encrypt before storing in database
encrypted_fp = generator.encrypt_fingerprint(fingerprint)
database.store(user_id, encrypted_fp)Option 3: Hardware token
pip install device-fingerprinting-pro[hardware-token]
# Store fingerprint on hardware security tokenNever:
- Store fingerprints in plain text
- Log fingerprints
- Transmit fingerprints over unencrypted channels
Use version checking:
from device_fingerprinting import AdvancedDeviceFingerprinter
fingerprinter = AdvancedDeviceFingerprinter()
# Get detailed fingerprint with components
result = fingerprinter.generate_fingerprint(include_debug_info=True)
# Store the components
stored_components = result.components
# Later, compare components
new_result = fingerprinter.generate_fingerprint(include_debug_info=True)
# Find differences
differences = set(stored_components) - set(new_result.components)
if differences:
print(f"Hardware changes detected: {differences}")Yes, the library implements multiple security layers:
- AES-256-GCM encryption for data at rest
- Scrypt key derivation against brute force attacks
- OS keyring integration for credential storage
- TPM support for hardware-backed security
- No sensitive data logging
See Security Architecture for details.
Theoretically, yes, but:
- Fingerprints identify devices, not people
- Multiple people can use the same device
- One person can use multiple devices
- Fingerprints should be treated as personally identifiable information (PII)
- Follow privacy regulations (GDPR, CCPA) when handling fingerprints
Best practices:
- Hash fingerprints before storing
- Use differential privacy techniques
- Minimize fingerprint collection
- Inform users about fingerprinting
- Provide opt-out mechanisms
If an encryption key is compromised:
-
Immediately rotate the key:
# Generate new key new_key = os.urandom(32) # Re-encrypt all data with new key # Destroy old key
-
Review audit logs for suspicious access
-
Notify affected users
-
Change passwords derived from the key
-
Consider enabling TPM for additional protection
Yes, with proper implementation:
- Transparency: Inform users about fingerprinting
- Purpose Limitation: Use only for stated purposes
- Data Minimization: Collect only necessary data
- Integrity: Protect fingerprints with encryption
- Right to Access: Allow users to request their data
- Right to Delete: Implement fingerprint deletion
Implementation example:
# GDPR-compliant fingerprinting
class GDPRCompliantFingerprinting:
def __init__(self):
self.generator = ProductionFingerprintGenerator()
self.consent_store = {}
def request_consent(self, user_id, purpose):
"""Request user consent for fingerprinting."""
# Implementation: Show consent dialog
self.consent_store[user_id] = {
"purpose": purpose,
"timestamp": datetime.now(),
"version": "2.2.3"
}
def generate_if_consented(self, user_id):
"""Generate fingerprint only if user consented."""
if user_id in self.consent_store:
return self.generator.generate_device_fingerprint()
else:
raise PermissionError(f"No consent for user {user_id}")
def delete_data(self, user_id):
"""Delete stored fingerprint data."""
if user_id in self.consent_store:
# Delete fingerprint from storage
storage_key = f"fingerprint_{user_id}"
self.generator.delete_fingerprint(storage_key)
del self.consent_store[user_id]Post-quantum algorithms are supported:
pip install device-fingerprinting-pro[pqc]Algorithms included:
- Kyber: Key encapsulation (replaces ECDH)
- Dilithium: Digital signatures (replaces ECDSA)
- Falcon: Lightweight signatures
- Others as standardized by NIST
Implementation:
from device_fingerprinting import ProductionFingerprintGenerator
generator = ProductionFingerprintGenerator()
# Use quantum-resistant fingerprint method
result = generator.generate_fingerprint(method="quantum_resistant")
# Or enable PQC for storage
generator.use_pqc_encryption(True)Minimal impact:
| Operation | Time |
|---|---|
| System metrics collection | 5-10ms |
| ML model inference | 10-50ms |
| Total anomaly detection | 15-60ms |
To optimize:
# Use less frequent checks in production
generator.set_anomaly_check_interval(60) # Every 60 seconds
# Reduce features for faster detection
generator.set_feature_set("minimal") # vs "standard", "comprehensive"More stable = slightly slower:
- Basic method: 50ms (fastest, less stable)
- Advanced method: 150ms (balanced)
- Quantum-resistant: 300ms (slowest, most stable)
Choose based on your needs:
# For speed-critical applications
from device_fingerprinting import FingerprintMethod
result = generator.generate_fingerprint(method=FingerprintMethod.BASIC)
# For security-critical applications
result = generator.generate_fingerprint(method=FingerprintMethod.QUANTUM_RESISTANT)Yes, fingerprints are stable and can be cached:
import time
class FingerprintCache:
def __init__(self, cache_duration_seconds=3600):
self.generator = DeviceFingerprintGenerator()
self.cache = {}
self.cache_duration = cache_duration_seconds
def get_fingerprint(self):
"""Get fingerprint with caching."""
if 'fingerprint' in self.cache:
cached_time, fingerprint = self.cache['fingerprint']
if time.time() - cached_time < self.cache_duration:
return fingerprint
# Generate new fingerprint
fingerprint = self.generator.generate_device_fingerprint()
self.cache['fingerprint'] = (time.time(), fingerprint)
return fingerprintTPM (Trusted Platform Module) is a hardware security chip that:
- Protects keys: Stores encryption keys in hardware
- Attests hardware: Proves device identity
- Measures state: Tracks system configuration
- Prevents tampering: Detects unauthorized changes
You need it for:
- Highest security requirements
- Hardware-based key protection
- Compliance certifications
- Enterprise deployments
from device_fingerprinting import get_tpm_status
status = get_tpm_status()
print(f"TPM Available: {status['tpm_hardware_available']}")
print(f"TPM Version: {status.get('tpm_version', 'N/A')}")
print(f"TPM Manufacturer: {status.get('tpm_manufacturer', 'N/A')}")Alternative checks:
Windows:
Get-WmiObject -Namespace "root\cimv2\security\microsoftvolumeencryption" -Class "Win32_EncryptableVolume"Linux:
ls -la /dev/tpm*
dmesg | grep -i tpmmacOS:
system_profiler SPiBridgeDataTypeYes, TPM is optional. The library provides:
- Software fallback: Works without TPM
- Graceful degradation: Automatically uses available features
- Feature detection: Checks for TPM at runtime
generator = ProductionFingerprintGenerator()
# Automatically uses TPM if available
fingerprint = generator.generate_device_fingerprint()
# Or explicitly disable TPM
generator.use_tpm(enabled=False)
fingerprint = generator.generate_device_fingerprint()Causes: Incomplete installation or missing optional dependencies
Solutions:
# Reinstall completely
pip uninstall device-fingerprinting-pro
pip install device-fingerprinting-pro
# Or, install with all optional features
pip install device-fingerprinting-pro[all]Solution: Adjust sensitivity threshold
generator = ProductionFingerprintGenerator()
# Lower sensitivity (fewer false positives)
generator.set_anomaly_threshold(0.8) # 0-1, higher = less sensitive
# Or provide baseline
baseline = generator.get_system_metrics()
is_anomalous, _ = generator.detect_anomaly(
current_metrics,
baseline=baseline
)Solution: Configure TPM permissions
# Check TPM device permissions
ls -la /dev/tpm0
# Add user to tpm group
sudo usermod -a -G tpm $(whoami)
# Apply group membership
newgrp tpm
# Verify
groupsSolution: Switch storage backend
generator = ProductionFingerprintGenerator()
# Use faster in-memory storage for temporary data
generator.set_storage_backend("memory")
# Or use OS keyring
generator.set_storage_backend("keyring")
# For persistent storage
generator.set_storage_backend("encrypted_filesystem")See CONTRIBUTING.md for guidelines on:
- Setting up development environment
- Code style and testing
- Pull request process
- Areas for contribution
Do not: Post publicly on GitHub issues
Do: Email security details to ajibijohnson@jtnetsolutions.com with:
- Vulnerability description
- Steps to reproduce
- Potential impact
- Suggested fixes
See SECURITY.md for full details.
-
Check existing issues to avoid duplicates
-
Open an issue with:
- Clear use case description
- Example code
- Why it's needed
- Proposed implementation (optional)
-
Discuss with maintainers before implementation
See CHANGELOG.md for details on each release.
Current Version: 2.2.3
Version Support:
- Latest (2.2.3): Full support
- 2.1.x: Security patches only
- 2.0.x: No support
Not recommended. Use virtual environments instead:
# Environment for old version
python -m venv env_old
source env_old/bin/activate
pip install device-fingerprinting-pro==2.1.0
# Environment for new version
python -m venv env_new
source env_new/bin/activate
pip install device-fingerprinting-pro==2.2.3- Documentation: See guides directory
- API Reference: See api/reference.md
- Issues: GitHub Issues
- Email: ajibijohnson@jtnetsolutions.com
- Security Issues: See SECURITY.md