Skip to main content

File digital signature

Project description

Signas

Secure File Digital Signature & Integrity Verification Tool

Signas is a lightweight digital signature tool built in Python. It uses RSA (2048-bit) asymmetric cryptography to ensure not only file integrity but also the authenticity of the signer.


🔗 Developer API Documentation

For programmatic usage, see: https://github.com/TAICHI1129/Signas/blob/main/api.md


Features

  • RSA Digital Signatures Prevents forgery of signature files (.signas).

  • Strong Tamper Detection Uses SHA-256 with streaming to verify even multi-GB files with low memory usage.

  • Identity Verification Includes signer name and optional GitHub profile.

  • Audit Log All signing and verification activities are automatically recorded in audit.log.

  • Password Protection Private keys are encrypted with a passphrase to prevent misuse if stolen.


Installation

pip install signas

Note: Requires the cryptography library for RSA functionality.


CLI Usage

1. Generate Key Pair

Before signing, generate your personal key pair:

signas genkey
  • private_key.pemKeep this secret
  • public_key.pem → Share with others for verification

2. Sign a File

Create a signature file to prove authenticity:

signas sign <file> <signer_name> [github_url]

Example:

signas sign data.zip TAICHI1129 https://github.com

3. Verify a File

Verify integrity and authenticity:

signas verify <file>

Requirements:

  • Target file
  • <file>.signas
  • public_key.pem

.signas File Format

.signas is a JSON file containing:

  • info

    • SHA-256 hash
    • signer name
    • GitHub link (optional)
  • signature

    • Base64-encoded RSA-PSS signature

Example

{
  "info": {
    "hash": "5a51be41913d0...",
    "signer": "TAICHI1129",
    "github": "https://github.com"
  },
  "signature": "MIIBIjANBgkqh..."
}

Security Notes

  • Private Key Management Losing private_key.pem or its password means you can no longer sign files.

  • Public Key Distribution Always obtain public keys from trusted sources.


Usage Examples

1. Generate Keys (One-time setup)

signas genkey

Input:

  • Password to protect your private key

Output:

  • private_key.pem
  • public_key.pem

2. Sign a File

Example A (Name only)

signas sign report.pdf "Taro Yamada"

Example B (With GitHub link)

signas sign software.zip "TAICHI1129" "https://github.com"

Input:

  • Password set during key generation

Output:

  • report.pdf.signas or software.zip.signas

3. Verify a File

Run in a directory containing:

  • target file
  • .signas file
  • public_key.pem
signas verify software.zip

Success

✅ Verification Successful

Failure (Tampered)

❌ Verification Failed: File content has been tampered with!

Failure (Invalid Signature)

❌ Verification Failed: Invalid or forged signature.

4. View Audit Log

# Windows
type audit.log

# Mac / Linux
cat audit.log

Example:

[2024-05-20 12:00:00] ACTION: SIGN | FILE: software.zip | STATUS: SUCCESS | Signed by TAICHI1129

5. Hash Only

signas hash sample.txt

Windows Users

If the signas command does not work:

python -m signas.cli

Summary

Signas provides:

  • Secure digital signatures (RSA)
  • Reliable tamper detection (SHA-256)
  • CLI and JSON API support

Use CLI for manual operations and the JSON API for development.

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

signas-0.2.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

signas-0.2.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file signas-0.2.0.tar.gz.

File metadata

  • Download URL: signas-0.2.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for signas-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9a5ee50d351e9e526d54cb2e0b8c8d0e00c707192cfcdcf16cda6ba4cfadcc5e
MD5 e9a9e73617f51bbc126ee0375017e9ce
BLAKE2b-256 3d31dcbf7e42a8defaf76a2b184e82d39580481dd55743a6656f4ac52063f7f3

See more details on using hashes here.

File details

Details for the file signas-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: signas-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for signas-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4fb400a1cb1e6ffd0cbe3e433c93c4e0aa7ad3fe2bd1ded6a154ee7e54235d00
MD5 9dcaa4eb8736c3994ba69d7b5b812975
BLAKE2b-256 4cb6a15b0dc9622d82d2f230ed08136b5571861d55e0737cf510591410a05418

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