Skip to content

Software License Dongle for Python

The Python binding is pure ctypes over the core library, so there is no compiler involved at install time and no wheel to build per interpreter version.

pip install keynub-licdongleCode language: Bash (bash)

Reading a license

from keynub import Dongle

with Dongle.open() as dongle:            # first dongle found
    if not dongle.is_genuine:
        raise SystemExit("no genuine KeyNub found")

    dongle.session_open()
    license = dongle.record_read("license")Code language: Python (python)

Python needs this more than most languages

Python ships as source, or as a bundle a determined person can unpack. PyInstaller, Nuitka and cx_Freeze raise the effort a little, but .pyc files decompile well and a licence check written as an if is a one-line patch. This is not a reason to avoid Python; it is a reason to put the dongle somewhere that patching cannot reach:

# Weak -- delete one line and it is gone.
if dongle.is_genuine:
    enable_feature()

# Strong -- the model, table or key only decrypts with the dongle present.
weights = dongle.app_decrypt(encrypted_blob_shipped_with_your_installer)Code language: Python (python)

For scientific and engineering software this is usually easy, because there is almost always a calibration table, a coefficient set, a trained model or a protocol key that the program cannot invent for itself.

Running your test suite without hardware

The SDK includes an in-process software dongle that speaks the real protocol, so CI can exercise the whole flow — authentication, session, records, app-crypto — on a build server with nothing plugged in. Your tests do not have to skip the licensing path.

All supported languages · Buy a KeyNub · Ask us something

KeyNub

A project of AB-Tools GmbH.
Address: Marsstraße 78 · 80335 Munich · Germany
Phone: +49 89 38898588 · Fax: +49 89 38898589
E-mail: info@keynub.com

Managing Director: Andreas Breitschopp
Commercial register HRB 202859 · Amtsgericht München (Munich local court)
VAT ID DE268720895 · Munich tax office for corporations
Grenke Bank AG · IBAN: DE49201304000060270139 · BIC: GREBDEH1XXX

Developers · Payment Methods · Shipping · Terms & Conditions · Right of Withdrawal · Privacy Policy · Legal Notice