फ़ाइलों के लिए डिजिटल सिग्नेचर: प्रामाणिकता और उत्पत्ति सिद्ध करें
जानें डिजिटल सिग्नेचर फ़ाइल प्रामाणिकता को कैसे सत्यापित करते हैं और छेड़छाड़ रोकते हैं।
Digital signature एक cryptographic proof है कि किसी specific व्यक्ति या entity ने एक फ़ाइल बनाई और वह फ़ाइल तब से बदली नहीं है। Technically: SHA-256 से फ़ाइल hash करें, फिर RSA-PSS, ECDSA, या Ed25519 से अपनी private key से hash "sign" करें। आपकी public key रखने वाला कोई भी signature verify कर सकता है — अगर check out हो, तो वह जानता है कि आपने फ़ाइल author की और यह byte-identical है जो आपने sign की थी। Signatures वही हैं जो macOS app updates verify करने में use करता है, Git commit authorship (git commit -S) में, और PGP signed emails में। ये एक ऐसी समस्या solve करते हैं जो encryption अकेले नहीं कर सकता: यह prove करना कि किसने क्या भेजा।
Signatures बनाम Encryption: अलग-अलग काम
Encryption contents को secret रखता है। Signatures authorship और integrity prove करते हैं। ये complementary हैं, alternatives नहीं।
- केवल Encrypt करें: recipient contents जानता है लेकिन किसने भेजा नहीं। Public key रखने वाला कोई भी encrypt कर सकता था।
- केवल Sign करें: recipient जानता है किसने भेजा और कि यह tamper नहीं हुई, लेकिन intercept करने वाले को content visible है।
- Sign और Encrypt करें: पूरी authenticity, integrity और confidentiality। PGP का default mode।
File transfer services आमतौर पर encryption पर focus करती हैं। Signatures high-trust contexts में आते हैं: software distribution, legal documents, contracts, forensic evidence chains।
Signing वास्तव में कैसे काम करता है
Canonical Ed25519 signing flow:
- Message hash करें:
h = SHA-512(message)। - Deterministic nonce compute करें:
r = SHA-512(private_key_prefix || h)। - Signature point compute करें:
R = r·G(जहाँ G curve का base point है)। - Compute करें
s = r + SHA-512(R || public_key || h)·private_key mod ℓ। - Signature है
(R, s), कुल 64 bytes।
Verification केवल public key, message और signature use करता है। अगर math काम करे, तो verifier जानता है कि signature matching private key रखने वाले किसी ने produce किया।
RSA-PSS (PKCS#1 v2.2) और ECDSA similarly काम करते हैं लेकिन different underlying math के साथ। Ed25519 नए systems के लिए preferred है क्योंकि यह deterministic है (कोई per-signature random nonce नहीं जो गलत हो) और faster है।
तीन Common Signature Algorithms
| Algorithm | Key size | Signature size | Speed | Notes | |-----------|----------|----------------|-------|-------| | RSA-PSS-2048 | 256 bytes | 256 bytes | ~1000 sign/s | Widely supported, slow key generation | | ECDSA P-256 | 32 bytes | 64 bytes | ~30,000 sign/s | NIST curve, needs secure RNG per signature | | Ed25519 | 32 bytes | 64 bytes | ~50,000 sign/s | Deterministic, modern default |
तीनों NIST के FIPS 186-5 (2023) में approved हैं। Ed25519 नए protocols का choice है: WireGuard, SSH (OpenSSH 8.0 से default), Signal, Git commit signing, और Rust का Cargo package signing।
Code Signing: एक $100 Billion Use Case
Software distribution signatures पर rely करती है। इनके बिना, users real installer और malware में distinguish नहीं कर सकते:
- Apple Developer ID + Notarization। Catalina (2019) से सभी macOS apps signed और notarized होने चाहिए। RSA-2048 या ECDSA P-256 use करता है।
- Microsoft Authenticode। Windows executables RSA-3072 या ECDSA P-384 certificates से signed।
- Android APK v2/v3। APK contents पर Ed25519 signatures।
- Debian apt, Red Hat dnf, npm, PyPI, Homebrew। सभी package manifests पर detached signatures use करते हैं।
एक famous incident: 2020 में, SolarWinds' Orion update company के legitimate certificate से signed था जब attackers ने build system compromise किया। Signature valid था — इसने बस यह prove किया कि code compromised source से आया। Signatures signer की identity guarantee करते हैं, signer का judgment नहीं।
फ़ाइलों के लिए PGP और Detached Signatures
GnuPG (gpg) अभी भी corporate PKI के बाहर file signatures का workhorse है। Detached signature फ़ाइल को unmodified रखती है और signature एक separate .sig file में डालती है:
gpg --detach-sign --armor document.pdf
# Produces document.pdf.sig
gpg --verify document.pdf.sig document.pdf
# gpg: Good signature from "Alice <alice@example.com>"
PGP की weakness key distribution है: verifier कैसे जाने कि signing key वास्तव में Alice की है? Options: keyservers, web of trust, keybase.io, या out-of-band verification।
Modern alternatives: Sigstore (Kubernetes, npm द्वारा used) OIDC identity tokens से keyless signing करता है, web of trust को transparency logs से replace करके। minisign by Frank Denis PGP की complexity के बिना simple Ed25519 signing offer करता है।
Hash-Based Signature Aggregation
Files के collections के लिए, हर एक को individually sign करना inefficient है। बेहतर: हर फ़ाइल hash करें, Merkle tree build करें, root sign करें। Advantages:
- एक signature कई files cover करती है।
- Individual files को log(n) sibling hashes के साथ root के खिलाफ verify किया जा सकता है।
- Certificate transparency logs, Git, और increasingly software supply chain tools like in-toto द्वारा use होता है।
10,000-file release इस तरह signed करने पर एक signature plus 32-byte root hash produce होता है, files के किसी subset के खिलाफ verifiable।
Timestamping: कब का Proof
Signature who prove करता है, when नहीं। आपकी private key steal करने वाला attacker signatures backdate कर सकता है। Trusted Timestamping Authorities (TSAs) आपकी signature पर timestamp sign करके इसे specific moment से anchor करके इसे solve करते हैं।
Standards:
- RFC 3161 timestamping — Microsoft Authenticode, Adobe PDF signatures द्वारा used।
- RFC 5544 (CMS with timestamps)।
- Roughtime — Google का low-latency verified time के लिए newer protocol।
Legal document signing (DocuSign, Adobe Sign, EU eIDAS qualified signatures) RFC 3161 timestamps पर rely करती है contract कब signed हुआ establish करने के लिए।
File Transfer में Signatures
अधिकांश consumer-facing file transfer services directly signatures expose नहीं करतीं — AES-GCM authentication tag transfer के भीतर integrity prove करता है, और TLS server की identity prove करता है, लेकिन sender की identity prove करने का कोई built-in तरीका नहीं है।
High-trust transfers के लिए, signing upload से पहले होती है:
- Sender Ed25519 या PGP से फ़ाइल sign करता है,
file.extऔरfile.ext.sigproduce करते हुए। - दोनों files किसी भी transfer service पर upload होती हैं (HexaTransfer, SwissTransfer, WeTransfer)।
- Recipient दोनों download करता है, sender की public key से signature verify करता है।
यह authenticity को transfer mechanism से decouple करता है — transfer service compromise हो सकती है बिना signature की validity तोड़े, जब तक sender की private key secret रहे और recipient के पास correct public key हो।
EU eIDAS Qualified Signatures
European Union का eIDAS Regulation (EU 910/2014, 2024 में eIDAS 2.0 के रूप में revised) तीन signature tiers define करता है:
- Electronic signature — basic, scanned handwritten signatures include।
- Advanced electronic signature (AdES) — signer से linked, tampering detect करता है। PGP signatures qualify।
- Qualified electronic signature (QES) — AdES plus Trust Service Provider से qualified certificate, Qualified Signature Creation Device (smart card या HSM) पर stored।
QES का EU के सभी member states में handwritten signature जैसा ही legal weight है। Providers: DocuSign EU, Adobe Sign EU, Namirial, DTrust। US equivalents ESIGN Act और UETA के तहत less formally tiered लेकिन functionally comparable हैं।
DPDP Act 2023 और Digital Signatures
भारत का DPDPA Section 8(5) digital fiduciaries को reasonable security safeguards implement करने require करता है। High-value transactions के लिए — जैसे legal agreements, financial documents, या regulatory filings — digital signatures authentication और non-repudiation add करते हैं जो basic encryption provide नहीं कर सकता। IT Act 2000 के तहत electronic signatures India में legally valid हैं।
Signatures कब Overkill हैं
हर फ़ाइल को signature नहीं चाहिए। Skip करें जब:
- Recipient end-to-end transfer channel (Signal, in-person USB) trust करता है।
- Content security-critical नहीं है (meeting photos, recipes, draft documents)।
- Integrity अकेले AES-GCM या TLS से provided और sufficient है।
Signatures add करें जब:
- Legal या contractual weight matter करता है (contracts, court evidence, medical records)।
- Supply chain trust in play है (software releases, firmware updates)।
- फ़ाइल untrusted intermediaries के ज़रिए forward होगी।
- Original transfer survive करने वाला durable audit trail चाहिए।
इसे Use में लगाएं
Simple workflow के लिए: ssh-keygen -t ed25519 -f ~/.ssh/signing_key से Ed25519 key generate करें, openssl pkeyutl -sign -inkey signing_key -in file -out file.sig से फ़ाइल sign करें, अपनी public key out of band share करें, और फ़ाइल किसी भी secure transfer service से ship करें। Recipients openssl pkeyutl -verify से verify करें।
hexatransfer.com पर आज़माएं — मुफ्त, बिना अकाउंट, 10 GB तक।
एंड-टू-एंड एन्क्रिप्शन के साथ बड़ी फ़ाइलें सुरक्षित रूप से भेजें
एंड-टू-एंड एन्क्रिप्शन के साथ 10 GB तक की फ़ाइलें मुफ़्त में ट्रांसफ़र करें। अकाउंट की आवश्यकता नहीं। अपलोड से पहले आपकी फ़ाइलें ब्राउज़र में एन्क्रिप्ट की जाती हैं — कोई और उन्हें पढ़ नहीं सकता।
फ़ाइल भेजें