Skip to main content

ECC-based Integrity Verification using ECDSA and SHA-256

Project description

ECC Integrity Verification

ecc-integrity is a lightweight Python package that ensures message authenticity and integrity using Elliptic Curve Cryptography (ECC) and ECDSA (Elliptic Curve Digital Signature Algorithm) with SHA-256. It is ideal for cryptographic use-cases in secure communications, IoT, digital documents, and authentication protocols.


🔒 Key Features

  • ECC Key Pair Generation (SECP256R1 curve)
  • Digital Signature Generation using ECDSA and SHA-256
  • PEM-format Public Key Export
  • Signature Verification by the Receiver
  • CLI Tool: verify-integrity for terminal-based demo
  • Lightweight, fast, and secure

📦 Requirements

Install dependencies with:

pip install -r requirements.txt

⚙️ Installation

1. Clone and Install

git clone https://github.com/yourusername/ecc_integrity.git
cd ecc_integrity
pip install .

2. From PyPI (after uploading)

pip install ecc-integrity

🚀 Example Usage

🐍 In Python Script

from ecc_integrity import ECCIntegrity

# Sender side
sender = ECCIntegrity()
message = b"Secure Communication"
signature = sender.sign_message(message)
pub_key = sender.export_public_key()

# Receiver side
receiver = ECCIntegrity()  # Simulated receiver
is_valid = receiver.verify_signature(message, signature, pub_key)

if is_valid:
    print("✅ Integrity Verified")
else:
    print("❌ Message has been tampered with")

💻 CLI Demo

verify-integrity

This command:

  • Generates key pair
  • Signs a demo message
  • Exports the public key
  • Verifies integrity of both original and tampered message

🧪 Output Sample

Message: Confidential Data Integrity Check
Signature (Base64): MEUCIQD0...
Sender Public Key:
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYI...
-----END PUBLIC KEY-----
✅ Integrity Verified: The message is authentic.
❌ Integrity Check Failed! Tampered message detected.

📈 Applications

  • Secure messaging protocols
  • Software update validation
  • Blockchain and cryptocurrency
  • IoT communication
  • Digital document integrity

🔐 Security Notes

  • Uses SECP256R1 for ECC, a widely accepted and NIST-approved curve.
  • Uses SHA-256 hashing within ECDSA.
  • Public key is exportable in PEM format for easy sharing and verification.

🗃️ Future Enhancements

  • Add support for additional ECC curves
  • Include symmetric encryption with integrity
  • Provide integration demo with Flask or FastAPI
  • Include public key distribution examples (QR, files, web)

📜 License

MIT License © 2025 Mohammad Luqman, Salman Ali


✨ Author


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

pyeccintegrity-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

pyeccintegrity-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyeccintegrity-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.6

File hashes

Hashes for pyeccintegrity-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1e62ed1c2de1eb5007c37c671ffdc964db25cdf4fef3c98b3aaf65c2b7d45739
MD5 cd89f7e73627de3a2ee56fe5941c2c48
BLAKE2b-256 9c33e65f263c02e739de8ce9551e0c8ce446038d28a23b2dac9d0729d1c05388

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyeccintegrity-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.6

File hashes

Hashes for pyeccintegrity-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aafec2b3f6ec36e5b6fd1dfa4a0456c5af9ab2e23f95eb93abf7adba6bb42260
MD5 be635d770ef87805296b858e37994f7b
BLAKE2b-256 482d9769232c1a9054bbe02b4ec16e8ccc5118f67322f94d3d8b3181638f365a

See more details on using hashes here.

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