Skip to main content

Cross-platform device fingerprinting and HMAC-SHA256 authentication library

Project description

LattifAI Auth

Core authentication and hardware fingerprinting library for LattifAI projects. Built with Rust for high performance and security, with bindings for Python and WebAssembly.

Features

  • Hardware Fingerprinting: Cross-platform (macOS, Windows, Linux) unique device ID generation.
  • Secure Signing: HMAC-SHA256 request signing to prevent spoofing.
  • Multi-language Support:
    • Rust: Native implementation.
    • Python: High-performance extension module (via PyO3).
    • WebAssembly: For browser-based authentication (via wasm-bindgen).
    • C-FFI: Compatible with any language that supports C calling conventions.

Installation (Python)

pip install lattifai-auth

Usage (Python)

import lattifai_auth

# Get unique hardware ID (SHA-256 hex, 64 chars)
device_id = lattifai_auth.get_device_id()
print(f"Device ID: {device_id}")

# Generate signed payload for API requests
# Returns: {json}.{base64_signature}
api_key = "your-api-key"
payload = lattifai_auth.generate_auth_payload(api_key)
print(f"Payload: {payload}")

# Structured output with individual fields
parts = lattifai_auth.generate_auth_payload_parts(api_key)
print(f"Device:    {parts['device_id']}")
print(f"Timestamp: {parts['timestamp']}")
print(f"Platform:  {parts['platform']}")
print(f"Version:   {parts['version']}")
print(f"Signature: {parts['signature']}")

Error Handling

All functions raise ValueError on failure:

try:
    lattifai_auth.generate_auth_payload("")  # empty key
except ValueError as e:
    print(f"Error: {e}")  # "invalid input: api_key must not be empty"

Development

Prerequisites

  • Rust toolchain (1.70+)
  • Python 3.8+
  • maturin for Python builds
  • wasm-pack for WebAssembly builds

Build Native Library

make build-native

Build Python Wheel

maturin develop --features python   # install in dev mode
maturin build --release --features python  # build wheel

Run Tests

cargo test                  # Rust unit tests
pytest tests/ -v            # Python integration tests

Build WebAssembly

make build-wasm

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

lattifai_auth-0.2.0-cp314-cp314-win_amd64.whl (148.7 kB view details)

Uploaded CPython 3.14Windows x86-64

lattifai_auth-0.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (285.8 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

lattifai_auth-0.2.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (521.9 kB view details)

Uploaded CPython 3.14macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

lattifai_auth-0.2.0-cp313-cp313-win_amd64.whl (148.9 kB view details)

Uploaded CPython 3.13Windows x86-64

lattifai_auth-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (286.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

lattifai_auth-0.2.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (522.4 kB view details)

Uploaded CPython 3.13macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

lattifai_auth-0.2.0-cp312-cp312-win_amd64.whl (148.9 kB view details)

Uploaded CPython 3.12Windows x86-64

lattifai_auth-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (286.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

lattifai_auth-0.2.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (521.9 kB view details)

Uploaded CPython 3.12macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

lattifai_auth-0.2.0-cp311-cp311-win_amd64.whl (150.7 kB view details)

Uploaded CPython 3.11Windows x86-64

lattifai_auth-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (289.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

lattifai_auth-0.2.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (524.7 kB view details)

Uploaded CPython 3.11macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

lattifai_auth-0.2.0-cp310-cp310-win_amd64.whl (150.7 kB view details)

Uploaded CPython 3.10Windows x86-64

lattifai_auth-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (289.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

lattifai_auth-0.2.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (525.3 kB view details)

Uploaded CPython 3.10macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file lattifai_auth-0.2.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 b27410f09449f4647e26a95db8893b394aa41b0425aeaaf00d221a8b65d06edb
MD5 d1015c4e9f2c967e578358a4136dd05e
BLAKE2b-256 ea2dd6eee74b27afd3ebb6b3ecc02d36d20520d2d5e4b323b396242840bda979

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp314-cp314-win_amd64.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattifai_auth-0.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d65a4c8a3943c817c4a8cae4b834936ec6df89e072ad94712d1f102029dd6b72
MD5 9a64824fafd01ea983031f8ab088f700
BLAKE2b-256 6d2b458485e95907576b287d65d27463269077b5f67af8846d722e156232a710

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattifai_auth-0.2.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 5706a2872d8ff55d9db47f0cba10ea4c575a502dde83f96fb41d44d25c4cb170
MD5 909eee16697432c1970944286d2d99d2
BLAKE2b-256 2bbe71f97d2e7b699fc5ef589da61327c7417c59e9906a9c619211d5a0e9b527

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattifai_auth-0.2.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a6ece8eee90560733649f5c97126e7af78a12e257a2b813cb2bc24847b66977c
MD5 622e2a00f9718a8d47cdcc58995a2f8e
BLAKE2b-256 fb394c80a15e0ca2174f5c8976f6ad8b191325cf71538699d8891a266e2ded9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp313-cp313-win_amd64.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattifai_auth-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1a370a5f38567dba149f7eb3adecea9a3121f65e6654f458c6155528cc87fefe
MD5 cf0816f72f91fa95c1117ba716f4e2f6
BLAKE2b-256 70cf53a644851cd2a9be3c86eae1b2297cabd98743b7cbdfcf6c6cbfaa1979fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattifai_auth-0.2.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 c120f925675c83100d20b2fa308e85345165f2e69160eb77d5dbb90093711f05
MD5 d190442f571b9e114048c1b770aa59ce
BLAKE2b-256 1eab43b0cbf133c8aa5acc333ae7660066a310d9c88fe644b08b87c99f13d270

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattifai_auth-0.2.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1fbf7904ff443df6189b2a82d6118a7685cb57e7b7af6480fa82655a5ecdc06a
MD5 5259358225512f5090a80f00caa0272a
BLAKE2b-256 c8a7263b3328d6cc7ac08d767967b2dbe0127fb2f8ada5dae23bd6f23d464bbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp312-cp312-win_amd64.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattifai_auth-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ea8804c853f845f8d9eabb9039333eb1b723e07ac8d9177d1adf4cf0a6e00a7a
MD5 1a4f0b2aee3cccbb57f9c9b36ccc1372
BLAKE2b-256 facaa32007a2e873e0db857f837d5898a77a5d819a39c8a08387055f768cd272

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattifai_auth-0.2.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 52a1e4a4e5491bd8ede95a9ccb64a97f56019fcc33cc0d1f7a8313b76d726ab5
MD5 48b17743df15d91527059acd5abd879b
BLAKE2b-256 0b2e45f837cd2b250d2593bdd8c6d8312a26f03f0f228fa77ad2d41eff4f97b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattifai_auth-0.2.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6b34fd423663b30001c1506d803eee0f70f55c6c6dd4d81f92275dc6d8e855b3
MD5 5cf02ecd0fb30c70591d58c0b3ee5339
BLAKE2b-256 6323d6db71a7d01ff85d63b7586e629506ad2a99a4c0e7c601723b7b44a49bde

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp311-cp311-win_amd64.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattifai_auth-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eca94f088949d09fb07a8f674e6099f345884906b4a7616f7cec18f17c90ca21
MD5 db475952f95c10a35a5ff0f9ce7c1dca
BLAKE2b-256 699dd0c037158cf72aadf4026797b17a5a369c08b91a24251815a90a0b852703

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattifai_auth-0.2.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 628c2f9e3a3301ae945794b42110c2dad9e3a5fd19a58cf98f2600a992ad744c
MD5 54a2c3a524cda8a72d24f731ddc736e1
BLAKE2b-256 d8e78a9d6b7688692ff2e767ecbdd9822f655c92e9b88cc924bf3e9855fb3d3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattifai_auth-0.2.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 120fe1319759703b5f7e354b9924e616003ce5bea2ae8c5fe106d6490a8d5a0f
MD5 09dcb198c90dc8edeadca16ac5cf57c8
BLAKE2b-256 4b0d61e34bd3f97bfa47db8e7f32944e555e3a7a586bca7cae2f26fb1c2da7eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp310-cp310-win_amd64.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattifai_auth-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 00817f10aaee76a18196762d10830f430f5c69864a712800d9eee36b8a5935b9
MD5 8f20f668495777fbd5256bd866b2767a
BLAKE2b-256 aa63532d53fc13a23a43389a5959e61e754ba488d1ad3f4e55b0e094a15ef91f

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattifai_auth-0.2.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 67bb372b9d0c5184169e3c2e7cf24528f149dcbddd2e7f78ef364123299317b0
MD5 fe3a806e4ae508cde599e97a1d4996f6
BLAKE2b-256 7d50e84f6235e1d71126e919bdc1ea1149cb069ce73b9907e06f5b833e244c1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: pypi.yml on lattifai/lattifai-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page