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.1.0-cp314-cp314-win_amd64.whl (184.3 kB view details)

Uploaded CPython 3.14Windows x86-64

lattifai_auth-0.1.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (327.0 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

lattifai_auth-0.1.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (599.4 kB view details)

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

lattifai_auth-0.1.0-cp313-cp313-win_amd64.whl (184.4 kB view details)

Uploaded CPython 3.13Windows x86-64

lattifai_auth-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (327.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

lattifai_auth-0.1.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (599.7 kB view details)

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

lattifai_auth-0.1.0-cp312-cp312-win_amd64.whl (184.4 kB view details)

Uploaded CPython 3.12Windows x86-64

lattifai_auth-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (327.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

lattifai_auth-0.1.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (599.4 kB view details)

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

lattifai_auth-0.1.0-cp311-cp311-win_amd64.whl (186.2 kB view details)

Uploaded CPython 3.11Windows x86-64

lattifai_auth-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (331.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

lattifai_auth-0.1.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (602.8 kB view details)

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

lattifai_auth-0.1.0-cp310-cp310-win_amd64.whl (186.1 kB view details)

Uploaded CPython 3.10Windows x86-64

lattifai_auth-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (331.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

lattifai_auth-0.1.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (603.2 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.1.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.1.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 98e09a6823d93b2dc0431af3be19adb0bc0ad007614b884870e72226bc905bf7
MD5 f22d3a422120d957e16a1608311ec383
BLAKE2b-256 260d14da78b36a374a034ea29d3619e6e5f6abe66ce9ab9c5e00253f886802bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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.1.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.1.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9c82f20458a38f6df5468bf3e0966e4e14db4cd806a868101eb8db113bcaf177
MD5 f1c50285be360ecf8e790523b664b462
BLAKE2b-256 ba3ddb27db772fa0708d786fd7123bb344f32a951549eb6050ebe39c4c8ee6c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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.1.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.1.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 3d752c70cafaac7b6bc77b737c21315630e534467e6354410692baa2ae79777a
MD5 caeb76a6c56d17ec20a356f51be86a43
BLAKE2b-256 163f894ee9394836a9da02d95cb3b20dcdf65f404eadbb4bbe9c196fd59d4162

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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.1.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1c7bfb17f2262a9e911d29f565b605fb2a13e2c6e99a922cfe2d38f59b425a5f
MD5 8fd5113dd1ff55486eede866c3281656
BLAKE2b-256 40ac7c16a9e54a7b45c17aa36622b746f471892c4bc30320d52fa8f62c26f6ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c323dd63e8982120566d7d28aafc33374f63fe0803f7bd0d2d480333384250b9
MD5 7869d1485f1df5330665c502e385b402
BLAKE2b-256 56e0c1d7b3554e1c78f4c115cc0144d84ce834e38ac6460a6ca1b841d20c5b2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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.1.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.1.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 bac77e92415db2b85c4759f0e26b47f1113b66703cb048d72afdb30b8a3bf8df
MD5 770ff8f1a1af1cf3bdafe1db919c9cc7
BLAKE2b-256 b49eae46872d4b480bcb115cae5743147ac4c1cd7daaccc7cba410555b45614d

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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.1.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 471c5bbae43730e58b53a41081bcb5e5a8b8ee3a5d12b298fdd16157a3bcfbfe
MD5 ba2b17c811057e7fec34a87a47470f05
BLAKE2b-256 59b3658578200624d951e049256c62d4ebf948a6ad6a5e7198af4846fdadc6b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5f823d07fa3777d566f6400dd2407ec26116307da351f4215a5d1f80f56867c1
MD5 31e400815703ac02a53fb224b1d871c4
BLAKE2b-256 6b97a33ffd13100de7e889bc25906ce0e9ec41f8626f20ebcaa40ce255046246

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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.1.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.1.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 f488d17a5f03560489069a5da6f694d90f446c5336368606e56d390b6909d85d
MD5 59f462fe71824826c8c8b9c91774b7b9
BLAKE2b-256 0078f5d75fd4e30e9a68e75dbef6a415735ff8bddbd2ae3d10487f0c365fc892

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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.1.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 99c99e15021322c46f04eab8f939b148adc15bcd4d92c22050b948a6775e9dc0
MD5 00f6e24270a2ef77973f343116f100b1
BLAKE2b-256 47329488eb065b7faa0b1d19b15871bf44cfbb0f15be565be30c25ffbe341db3

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1a6fe2d966f18009200302388f6551c1789ba34050c6ac439cc36ef1d9acd9dd
MD5 aeec5276cdeefc2b699c455af5ac10f7
BLAKE2b-256 b000cd47fb3b14aadcd65858bf43c171be663df2521654163994264921a4521b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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.1.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.1.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 e8e33bc1046ad1017865fb5e7d555f7c1a64566064f9f006657e6018ddc3e106
MD5 1e379449709c561fa3ead2cb78382bfa
BLAKE2b-256 bfba8883ac71a26f39690d404cb4b5132d591ed0542326b5763e482b010f80ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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.1.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 efebf12df9417b3566d726a00b3f0cdc615014e76882024720481fe130603659
MD5 ff3749daf7c4ce4792864d51597a9161
BLAKE2b-256 85ddd9a6ce69e20c564175814443d4c070822d7b3680df544986f093e1e56610

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5aadb18bc9b1ba6a557213663b49334d2ce80adc0be1f335e7d81831c5639a8b
MD5 4083edd7eaad7bc65e39baf0d5e69fa0
BLAKE2b-256 7c61c342d8d0be7f575f3406d948e0d22b82d20b4dd5a53ce08f1fd5e07f53a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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.1.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.1.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 934d445824fd0a6da0afdd2aaacd154b97b9f1197bfa810f509db395c88fae68
MD5 84f5e0c3decbaad54a840e8fae53dd6e
BLAKE2b-256 53176b12efc516b1334af5314f0afe99d3dbcf9b98bc53c77fd6ac8175756ecf

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.1.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