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

Uploaded CPython 3.14Windows x86-64

lattifai_auth-0.2.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (287.5 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

lattifai_auth-0.2.1-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (524.7 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.1-cp313-cp313-win_amd64.whl (150.8 kB view details)

Uploaded CPython 3.13Windows x86-64

lattifai_auth-0.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (288.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

lattifai_auth-0.2.1-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (524.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.2.1-cp312-cp312-win_amd64.whl (150.9 kB view details)

Uploaded CPython 3.12Windows x86-64

lattifai_auth-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (288.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

lattifai_auth-0.2.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (524.6 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.1-cp311-cp311-win_amd64.whl (152.5 kB view details)

Uploaded CPython 3.11Windows x86-64

lattifai_auth-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (291.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

lattifai_auth-0.2.1-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (528.5 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.1-cp310-cp310-win_amd64.whl (152.6 kB view details)

Uploaded CPython 3.10Windows x86-64

lattifai_auth-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (291.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

lattifai_auth-0.2.1-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (529.0 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.1-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for lattifai_auth-0.2.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 434830b41779d05edf12d66201be45fd0f425e60e1c5daee69fcba2372718ebf
MD5 a2127000463e43ae3043f1951d90187f
BLAKE2b-256 63404926a16b3accda0e154531bf52ea81b628b0cda685d458ff801f662d70ca

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lattifai_auth-0.2.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 059ebba4e321e557b527432d9943fb77da78a98d7ae52f764642c726fbc76f08
MD5 121644994c84a77311b2a589a98dc8db
BLAKE2b-256 c68d08716f65ea2ca2a4a9f3aa5529ece83661243a25b59f8876fdbc386ae161

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.1-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.1-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.1-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 9951b0ca19997d7a348c9a06108b9bb395e96b9a5e3aa3364ac6e204286f9d7f
MD5 0c0f442aee3c6034c4d5beaa71e8c727
BLAKE2b-256 9e965f60e78e180f8a15f155645974b6025a84a540aa30e0cb4aac6a17a07c55

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lattifai_auth-0.2.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 be7054f1a2d31467eb4466eae7c6bd09eb6326148c737a1095d329d228918e2e
MD5 100feac7587dcbe052899ab820c57268
BLAKE2b-256 61d80584263157dbf069343d9351471b6cef8013662e9861853f0c71cb893dac

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lattifai_auth-0.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7e20df9384178ec4e0cdc443ae64fe1f477854018d815a1b230dfc3fa242f395
MD5 154297f0f08971f7139d18895298006f
BLAKE2b-256 e94e95587a42628e8f75d74ed3c3b3c13ed3fd588da4b4fe022c1ab126cb5a2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.1-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.1-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.1-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 d029864ba840930a880facc82ecb53af7a167c6e5a9dabaab3bae29b59681364
MD5 8c84f81191b264d059e5958aed0c00bf
BLAKE2b-256 cea504f05149d47ffe60f3441205044e748c0e8eafaefe19e1242c476c997867

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lattifai_auth-0.2.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a193560c742829640f92b3ab4f060b2e74060ae7404f0be43c5831c5def72efb
MD5 34a6495543258cfb24cb158c9bfc372e
BLAKE2b-256 2d8365035102b1e1f39f0422ddeb8bee977f5e7e766a83211b8997e30043da86

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lattifai_auth-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 01788170c0641033a42253a384f95746efab1ff51a64ffb287dca57f73dd0fb1
MD5 be00d7e30c15cd69962d888435c47265
BLAKE2b-256 ed7878dcb1d1ee9fbcb5b5d280534d18a789141160e86c67d21f20fc314332d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.1-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.1-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.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 a8e50e28f2dca075819655beffe48b769176f16d2f3c8042456604816377e75b
MD5 ebf0e73576a7c6bc40c250e1c281379b
BLAKE2b-256 3f364e1742d2f398f032fad77458829c4f2f671c07e13b75c328df2df8cb11ee

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lattifai_auth-0.2.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 aeec54eaf1fd58b913c8610cf75d4955d47624b86bec85e7f361515d1fafe6c6
MD5 f653bf94a591d0682381d717bfbceb60
BLAKE2b-256 22a37bf91efd76051f77be17c293c27325e4c53327e792e6ad958ddc88318d4a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lattifai_auth-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ecc31d36d84a30fb4e680f1e2ae9480006e298b685e670eceb86bd7d02041e6e
MD5 5ff082889aba034ffc481fb2f8c8c053
BLAKE2b-256 7c24cb7f5b4aaa5a122cd801feccdfe0da454193fcf6e8690fcd0cffe08af6e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.1-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.1-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.1-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 a13f440e963be7496c318fde885cbc1cd7e2d82f9b3ab00256de11dc1d0bc978
MD5 30098fd8c0c6c8368e8e13c14e938935
BLAKE2b-256 4c7d2ab7a9687c9fef5b92d8e82f40f728d143bbb246f44b93a414348bbe2d6a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lattifai_auth-0.2.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 421478e9329bbe0ebfaf16cf00946d4d50d7f4f7e7ea1b92d0e9048639f42cd5
MD5 e442748b6969fa81c92a8e6505d69db5
BLAKE2b-256 33455949b661b95b733c8f64da063fbf455f5bfcafbf41c152ba83578157e909

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lattifai_auth-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 72ce4c534ca01730bede4ac1a99918469346152da5104e27537c9134bb6df78a
MD5 432903178c4c73b89e34a37473e9615a
BLAKE2b-256 9bc901f9027db0640309f5b44a0229af12e43815115ad7cd58e355b7c4a416f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattifai_auth-0.2.1-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.1-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.1-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 c77525dc8deecc036461bbb1a72be96bcde8cadb2422dabd6ee0382426970c9d
MD5 aefcb55a24a80d0fc07415075dfeb5e7
BLAKE2b-256 5abaca14f18aeb79e136e209b40f7977eb7731cd0e7d1a6954f2ff1a235c9318

See more details on using hashes here.

Provenance

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