Skip to main content

Device Fingerprint

device_fingerprint is a Python library designed to generate a unique digital fingerprint based on the physical characteristics of an electronic device. It captures details like the device's battery status, exact system time (with millisecond precision), and MAC address. This library also provides secure handling of data by hashing with SHA-256 and encrypting using AES encryption.

Features

  • Generate Device Fingerprint: Create a unique fingerprint based on device characteristics.
  • Encrypt and Decrypt Data: Securely encrypt and decrypt data using AES encryption.
  • Retrieve Device Information: Get current battery status, system time, and MAC address.

Installation

To install the device_fingerprint library, use pip:

pip install device-fingerprint

Usage

Generating a Fingerprint

Here's how to use the device_fingerprint library to generate a unique fingerprint:

from device_fingerprint import DeviceFingerprint

# Define a 16-byte key for AES encryption
# AES key must be either 16, 24, or 32 bytes long
key = b'ThisIs16BytesKey!'

# Initialize the DeviceFingerprint class with your encryption key
fingerprint_generator = DeviceFingerprint(encryption_key=key)

# Generate a unique fingerprint for the device
fingerprint = fingerprint_generator.generate_fingerprint()
print(f"Fingerprint: {fingerprint}")

# Retrieve the device's MAC address
mac_address = fingerprint_generator.get_mac_address()
print(f"MAC Address: {mac_address}")

# Encrypt and decrypt data
encrypted_mac = fingerprint_generator.encrypt_data(mac_address)
print(f"Encrypted MAC Address: {encrypted_mac}")

decrypted_mac = fingerprint_generator.decrypt_data(encrypted_mac)
print(f"Decrypted MAC Address: {decrypted_mac}")

API Reference

DeviceFingerprint

  • Constructor: DeviceFingerprint(encryption_key: bytes)

    • Initializes the DeviceFingerprint class with the specified AES encryption key.
    • encryption_key: A byte string for AES encryption. Must be 16, 24, or 32 bytes long.
  • Method: generate_fingerprint()

    • Generates a unique fingerprint based on device characteristics.
    • Returns: A string representing the unique device fingerprint.
  • Method: get_mac_address()

    • Retrieves the MAC address of the device.
    • Returns: A string representing the MAC address.
  • Method: encrypt_data(data: str)

    • Encrypts the given data using AES encryption.
    • data: A string of data to encrypt.
    • Returns: A string representing the encrypted data.
  • Method: decrypt_data(encrypted_data: str)

    • Decrypts the given encrypted data using AES decryption.
    • encrypted_data: A string of encrypted data.
    • Returns: A string representing the decrypted data.

Security

  • Ensure that your AES encryption key is kept secure and private.
  • The library uses SHA-256 for hashing and AES for encryption to provide secure data handling.

Feel free to adjust the repository links and license details as needed.

Metadata

Release files for Device-Fingerprint 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for Device-Fingerprint 1.0
File Interpreter ABI Platform
Device_Fingerprint-1.0-py3-none-any.whl Python 3 none any Details

Release files / Device_Fingerprint-1.0-py3-none-any.whl

Download URL Device_Fingerprint-1.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf09d21323fefcfb2ae91ca4e07a8077e2bdd4def2ae3aba2be6f1a3dde39488
BLAKE2b-256 checksum
How to use checksums
1d032a52a4e2298799ffa6a5c2cd21de2495c5d6a5ab7056d9eae3d4df36db5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Security for Device-Fingerprint 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page