Skip to main content

Secure cryptographic channel demonstrating ECDH, AES-256-GCM, and HMAC integrity. Independent of Microsoft Presidio (a data-anonymization toolkit).

Project description

presidio-hardened-crypto-channel

Secure cryptographic channel demonstrating ECDH key exchange, AES-256-GCM authenticated encryption, and HMAC integrity. Used in Experiment 1 of PRES-EDU-SEC-101 — Computer Security.

Setup

git clone https://github.com/presidio-v/presidio-hardened-crypto-channel.git
cd presidio-hardened-crypto-channel
pip install -r requirements.txt

Experiments

Run 1 — ECDH Key Exchange

python main.py --demo keyexchange --parties Alice Bob

Both parties derive identical session keys without transmitting the secret.

Run 2 — AES-256-GCM Encryption

python main.py --demo symmetric --message "Hello from Alice" --key-size 256

Run 3 — Full Secure Channel

python main.py --demo channel --client Alice --server Bob --messages 10

Run 4 — Break It: Remove HMAC

python main.py --demo channel --no-hmac --tamper

Without authentication, a tampered message is detected by the GCM tag — demonstrating that AES-GCM provides both confidentiality and integrity.

Run 5 — Measure

python main.py --demo channel --messages 100 --duration 60
python report.py --experiment 1

What to Observe

  • --no-hmac --tamper: AES-GCM's auth tag catches the flip — InvalidTag raised
  • --tamper (HMAC on): HMAC check fires first, before decryption attempt
  • Key takeaway: encryption provides confidentiality; GCM tag / HMAC provides integrity

Package Structure

src/presidio_crypto_channel/
├── keyexchange.py   X25519 ECDH + HKDF
├── symmetric.py     AES-256-GCM
├── channel.py       Full channel with optional HMAC
└── security.py      Logging + pip-audit

License

MIT


SDLC

This repository is developed under the Presidio hardened-family SDLC: https://github.com/presidio-v/presidio-hardened-docs/blob/main/sdlc/sdlc-report.md.

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

presidio_hardened_crypto_channel-0.1.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

File details

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

File metadata

File hashes

Hashes for presidio_hardened_crypto_channel-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f0a51e1d349a9c23ed35fad0a04bd4200bc14ad1639067dc73c506429ba065b7
MD5 ebab89a5d5378fb3f0f9b1c9a615c2e2
BLAKE2b-256 af78baa2ccac7ff1e8ae3f76ce1f1805165a295798ceababfbecb51803c5c5e8

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on presidio-v/presidio-hardened-crypto-channel

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

File details

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

File metadata

File hashes

Hashes for presidio_hardened_crypto_channel-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a004d65ed4f43a3e6979762e7c059181f6c93de229aae71e30e4febfe795769
MD5 36eb4f257c5b8419280cdaeb1fa9b509
BLAKE2b-256 2a3d1cb69e4ae1220063fca34e1f1aa36ca47332db46697a8ab557bc421e09ec

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on presidio-v/presidio-hardened-crypto-channel

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