Skip to main content

Encrypt Verilog and VHDL files using the IEEE 1735 standard

Project description

IEEE 1735 HDL Encryptor

A Python tool to encrypt HDL (Verilog/VHDL) files following the IEEE 1735 standard.

Features

  • Supports Verilog and VHDL.
  • Detects code blocks marked with protection pragmas.
  • RSA key-based session key wrapping.
  • AES-256-CBC data encryption.
  • IEEE 1735 compliant formatting.

Installation

This project uses uv for dependency management.

From Source

  1. Clone the repository:

    git clone https://github.com/RasmusGOlsen/encrypt.git
    cd encrypt
    
  2. Install dependencies:

    uv sync
    

Usage

You can run the encryptor using uv run encrypt:

uv run encrypt <input_file> -k <public_key_pem> [options]

Arguments

  • input: The source HDL file (Verilog or VHDL).
  • -k, --key: Path to the recipient's RSA public key (PEM format).
  • -o, --output: (Optional) Path to the output file. Defaults to <input>.protected.
  • --owner: (Optional) Key owner name (default: "Unknown").
  • --keyname: (Optional) Key name (default: "default_key").
  • --full-file: (Optional) Encrypt the entire file content, ignoring any pragmas.

Example

uv run encrypt my_design.v -k company_pub_key.pem -o my_design_protected.v

How it Works

Protection Pragmas

The tool searches for specific pragmas in your source code to identify which blocks should be encrypted.

Verilog:

`pragma protect begin
// Your sensitive code here
`pragma protect end

VHDL:

`protect begin
-- Your sensitive code here
`protect end

Note: VHDL also supports -- pragma protect begin style pragmas.

Full File Encryption

If no pragmas are found, or if the --full-file flag is used, the entire content of the file will be encrypted and wrapped in IEEE 1735 headers.

Development

Running Tests

uv run pytest

Linting and Formatting

uv run ruff check .
uv run ruff format .

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

hdl_encrypt-0.1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

hdl_encrypt-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for hdl_encrypt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cc5828d40bcbc2858119874ec51c080b27a4733d35b1826f584849d9ccd352b2
MD5 83e5af4fca82ea5fdec04106e7005293
BLAKE2b-256 f65818c367249d9b0cf49c7c678e04b05d7218f34e3db394b73800aeb9895150

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on RasmusGOlsen/hdl-encrypt

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

File details

Details for the file hdl_encrypt-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hdl_encrypt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hdl_encrypt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64f6d68091ab2b23956f4d05c8e3e448c1860b8752408c951587391695111f04
MD5 6c53fc115ee6e4c2a7559f684fdbedf7
BLAKE2b-256 fb8e3afa857caad6f3a69ac330afb9a92491cc5137cf6cc192c4461550b9c277

See more details on using hashes here.

Provenance

The following attestation bundles were made for hdl_encrypt-0.1.0-py3-none-any.whl:

Publisher: publish.yml on RasmusGOlsen/hdl-encrypt

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