Skip to main content

Fast C++ PRINCE cipher backend for SPSDK IPED encryption.

Project description

SPSDK IPED - PRINCE Cipher Backend

High-performance C++ PRINCE cipher backend for SPSDK's IPED (Inline PRINCE Encryption/Decryption) module.

Installation

Prerequisites

A C++ compiler is required to build the native PRINCE cipher library:

  • Linux/macOS: GCC or Clang (install via your package manager)
  • Windows: MS Build Tools (instructions)

Install from source

pip install -e path/to/spsdk_plugins/iped

Install from Bitbucket

pip install git+ssh://git@bitbucket.sw.nxp.com/spsdk/spsdk_plugins.git#subdirectory=iped

Usage with SPSDK

When this package is installed, SPSDK's IPED module automatically detects the C++ backend and uses it for ~100-150x faster PRINCE cipher operations compared to the built-in pure-Python fallback.

No additional configuration is needed — just install the package alongside SPSDK.

Standalone usage

from spsdk_iped import IPED

# CTR mode encryption
cipher = IPED(key=0x01, address=0x80003000, iv=0x79EAFAB3A72412A1)
encrypted = cipher.encrypt(plaintext_bytes)

# Decryption
cipher2 = IPED(key=0x01, address=0x80003000, iv=0x79EAFAB3A72412A1)
decrypted = cipher2.decrypt(encrypted)

Performance

The C++ backend provides approximately 100-150x speedup over the pure-Python implementation:

Backend Throughput
Python (built-in) ~0.03 MB/s
C++ (this package) ~5 MB/s

License

BSD-3-Clause

Project details


Download files

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

Source Distribution

spsdk_iped-0.1.0.tar.gz (21.3 kB view details)

Uploaded Source

File details

Details for the file spsdk_iped-0.1.0.tar.gz.

File metadata

  • Download URL: spsdk_iped-0.1.0.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for spsdk_iped-0.1.0.tar.gz
Algorithm Hash digest
SHA256 41f6c75c058b71fbc15c5299d94d17d1069de405acca3dd231509b8851c982d0
MD5 13364f0680067a0ff1fc477e16c84a35
BLAKE2b-256 eead9536ddba8214735954641383c9933318ae0e6aac75264fc89168adfa36d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for spsdk_iped-0.1.0.tar.gz:

Publisher: deploy.yml on nxp-mcuxpresso/spsdk_plugins

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