Skip to content
Sign Up For Free
BatchKeys License Key SaaS
  • Pricing
  • Try Demo
  • Docs
  • SupportExpand
    • Tickets
  • AboutExpand
    • Contact
  • Dashboard
BatchKeys License Key SaaS

Getting Started

11
  • Setting Up An Account
  • Your Dashboard
  • Generating Keys
  • Viewing And Editing Keys
  • Viewing/Editing An Individual Key’s Details
  • Bulk Deleting Keys
  • Importing Keys
  • Encoding And Decoding PHP
  • Handling Refunds
  • Unbanning A Valid End User
  • Requesting An Enterprise or Custom Plan

Integrations

14
  • Inserting Code Into Your App
  • Making API Calls
  • Receiving A Response
  • Example JSON Response
  • Assigning Keys To A Domain Name
  • Generating Unique UUIDs
  • Assigning Keys To A UUID
  • Checking Keys Daily Using A Cron Job
  • Checking Keys At Startup
  • Consuming And Topping Up Tokens For Token-Based Keys
  • Server-Side Proxy For Client-Side JavaScript Connections
  • Forms To Collect A Key
  • Adding BatchKeys To A WordPress Plugin
  • Adding BatchKeys To A WordPress Theme

Best Practices

13
  • Using Domain/UUID Settings To Upsell Your App
  • Staying Within Rate Limits
  • Handling Errors
  • Dealing With Connection Failures And Rechecks
  • Securing Keys
  • Working Around Hardware Changes With V5 UUIDs
  • Working Around V4 UUID Security Concerns
  • Creating Good Validation Forms
  • How We Use UUIDs To Secure Keys
  • A Note About Example Codes
  • Can We Create Custom Code For You?
  • Maximum Key Limits Per Plan
  • Using A License Key Service In A Mobile App
  • Home
  • Docs
  • Best Practices
  • Working Around Hardware Changes With V5 UUIDs

Working Around Hardware Changes With V5 UUIDs

Since the Name in a version 5 UUID is based on a hardware ID, it’s a good idea to have a fallback system in case the device’s hardware changes. End users will often update parts of their PC’s and this can cause your app to no longer work on that device when it still should.

One way to do this is to save the UUID along with multiple hardware ID’s (disk ID, processor ID, MAC address, etc) in a local file (you should hide and/or encrypt this file) and then compare these saved values to the current values. You will be able to detect partial changes and make some assumptions about the device.

This lets you be reasonably sure the end user is only installing your app on the number of devices you want, but still gives them the freedom to upgrade their hardware or uninstall and reinstall your app without issue.

Checking Hardware Info #

Create a function in your app to check the device’s current information against the saved file. Your app will need elevated administrative privileges.

First, gather the users current hardware info:

import subprocess
import uuid
import re

def get_processor_id():
    # Execute the Windows command to get the processor ID
    result = subprocess.check_output(['wmic', 'cpu', 'get', 'ProcessorId'], shell=True)
    # Decode the result and split by newline to get the actual ID
    processor_id = result.decode().split('\n')[1].strip()
    return processor_id

def get_device_id():
    # Execute the Windows command to get the device ID
    result = subprocess.check_output(['wmic', 'csproduct', 'get', 'UUID'], shell=True)
    # Decode the result and split by newline to get the actual ID
    device_id = result.decode().split('\n')[1].strip()
    return device_id

def get_mac_address():
    # Get the MAC address using uuid.getnode() and format it
    mac = ':'.join(re.findall('..', '%012x' % uuid.getnode()))
    return mac

# Gather current hardware data
current_processor_id = get_processor_id()
current_device_id = get_device_id()
current_mac_address = get_mac_address()

# Print current hardware data (for testing)
print("Current Processor ID:", current_processor_id)
print("Current Device ID:", current_device_id)
print("Current MAC Address:", current_mac_address)

And then compare that info to the saved data…

 # Path to the file containing the saved hardware data
saved_data_file_path = "path/to/your/saved_hardware_data.txt"

# Read the saved hardware data from the file
with open(saved_data_file_path, 'r') as file:
    saved_device_id = file.readline().strip()
    saved_processor_id = file.readline().strip()
    saved_mac_address = file.readline().strip()

# Compare the current hardware data with the saved data
if (current_device_id == saved_device_id and
        current_processor_id == saved_processor_id and
        current_mac_address == saved_mac_address):
    print("Success! The current device matches the saved hardware data.")
else:
    print("Warning! The current device does not match the saved hardware data.")

Partial Matches #

If the UUID and one or more hardware ID’s don’t match, but at least one hardware ID does still match, you could assume the end user has upgraded their device but it is still the same device.

If Nothing Matches #

If nothing matches it likely means your app is running on a new device, possibly because of theft or because your user has bought a new PC. If the match fails you can handle it as your policies see fit, like directing them to contact you to confirm their identity before allowing a new UUID.

Updating UUIDs #

We do not allow UUIDs to be programmatically deleted or updated in the key library without a developer’s intervention. Once a UUID is set, it is locked to that key unless you manually change it in the Dashboard. There is no way to tell a legitimate update and a malicious end user apart that could not be exploited.

If you trust the use of the key is legitimate, you have some options. You can keep the old UUID and allow an additional UUID by increasing the maximum amount of UUIDs for that key, or you can simply delete the old UUID. Deleting the old UUID is the preferred method.

Editing UUIDs In The Dashboard #

To edit/delete a UUID, go to your Dashboard > View All Keys and use the search function to find the key. Click on the key to see that key’s settings. Find the UUID in the list and click it. Now you can either edit the UUID or leave the field blank to erase the UUID from the system.

dashboard single key

Additionally you must deactivate the key to assign it a new UUID. You can do this in your Dashboard. On the next key check the new device UUID will be assigned and locked to the key, and the key will be reactivated.

Until the UUID is updated in the Dashboard the key will continue to fail.

Was this Helpful?
Still stuck? How can we help?

How can we help?

Updated on April 4, 2024
Securing KeysWorking Around V4 UUID Security Concerns

Powered by BetterDocs

Table of Contents
  • Checking Hardware Info
    • Partial Matches
    • If Nothing Matches
  • Updating UUIDs
    • Editing UUIDs In The Dashboard
  • Get Early Access
  • Try Demo
  • Status
  • API Tester
  • Docs
  • Support
  • Feature Request
  • Feedback
  • About
  • Contact
  • Sitemap
  • Coupons

TOS

Privacy Policy

SLA

© 2025 Batch Keys | Created and maintained by Kayce Media Group

  • Pricing
  • Try Demo
  • Docs
  • Support
    • Tickets
  • About
    • Contact
  • Dashboard