Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikipedia

हैश फ़ंक्शन

Reference material by Wikipedia contributors. This retains its source identity and is not 411 news reporting.

सितंबर 2026 हैश फ़ंक्शन (Hash function) एक गणितीय फलन है जो किसी इनपुट, जैसे पाठ, फ़ाइल या अन्य डेटा को एक निश्चित लंबाई के आउटपुट में परिवर्तित करता है। इस आउटपुट को सामान्यतः हैश मान (hash value), हैश या डाइजेस्ट (digest) कहा जाता है।Hash Function, NIST Computer Security Resource Center. किसी हैश फ़ंक्शन का आउटपुट इनपुट की सामग्री पर निर्भर करता है। इसलिए इनपुट में परिवर्तन होने पर सामान्यतः अलग हैश मान प्राप्त होता है। इस गुण का उपयोग डेटा की अखंडता जाँच, डेटा संरचनाओं, डेटाबेस, कैशिंग, डिजिटल हस्ताक्षर तथा क्रिप्टोग्राफी में किया जाता है।FIPS 180-4: Secure Hash Standard, National Institute of Standards and Technology. सभी हैश फ़ंक्शन क्रिप्टोग्राफिक नहीं होते। सामान्य hash functions का उपयोग तेज़ी से डेटा को व्यवस्थित या खोजने के लिए किया जा सकता है, जबकि क्रिप्टोग्राफिक हैश फ़ंक्शन को अतिरिक्त सुरक्षा गुणों, जैसे collision resistance, preimage resistance और second-preimage resistance, को ध्यान में रखकर डिजाइन किया जाता है।Cryptographic Hash Function, NIST Computer Security Resource Center. कार्यप्रणाली हैश फ़ंक्शन किसी इनपुट को एक निर्धारित algorithm के अनुसार संसाधित करके एक fixed-length output उत्पन्न करता है। इनपुट की लंबाई छोटी या बहुत बड़ी हो सकती है, जबकि किसी विशेष hash algorithm का output आकार निर्धारित होता है। उदाहरण के लिए SHA-256 algorithm 256-bit message digest उत्पन्न करता है। SHA-384 और SHA-512 क्रमशः 384-bit और 512-bit digest उत्पन्न करते हैं।Secure Hash Standard, NIST FIPS 180-4. सैद्धांतिक रूप से दो अलग-अलग inputs का एक ही hash value उत्पन्न होना संभव है, क्योंकि संभावित inputs की संख्या fixed-length outputs की संख्या से बहुत अधिक हो सकती है। ऐसी स्थिति को collision कहा जाता है। अच्छे cryptographic hash functions को इस प्रकार डिजाइन किया जाता है कि उपयोगी collision ढूँढ़ना computationally infeasible हो। प्रमुख गुण किसी hash function की उपयोगिता उसके application पर निर्भर करती है। Cryptographic hash functions के लिए प्रमुख सुरक्षा गुण निम्न हैं। निश्चित लंबाई का आउटपुट Hash function अलग-अलग लंबाई के inputs को निश्चित लंबाई के output में परिवर्तित करता है। उदाहरण के लिए SHA-256 प्रत्येक message के लिए 256-bit digest उत्पन्न करता है। प्रीइमेज प्रतिरोध Preimage resistance का अर्थ है कि केवल hash value दिए जाने पर ऐसा input ढूँढ़ना computationally infeasible होना चाहिए जो उस hash value को उत्पन्न करता हो। यह गुण hash को केवल उसके output से मूल input निकालने के प्रयासों के विरुद्ध सुरक्षा प्रदान करने में महत्वपूर्ण है। सेकंड प्रीइमेज प्रतिरोध Second-preimage resistance का अर्थ है कि किसी दिए गए input के लिए दूसरा अलग input ढूँढ़ना computationally infeasible होना चाहिए जिसका hash वही हो। यह गुण उन applications में महत्वपूर्ण हो सकता है जहाँ किसी मौजूदा message के स्थान पर दूसरा message रखने का प्रयास किया जा सकता है। Collision resistance Collision resistance का अर्थ है कि दो अलग-अलग inputs को ढूँढ़ना computationally infeasible होना चाहिए जिनका hash समान हो। Collision और preimage attack अलग समस्याएँ हैं। Collision attack में हम किसी भी दो अलग inputs की समान hash value खोजने का प्रयास करते हैं, जबकि preimage attack में पहले से दिए गए hash के अनुरूप input खोजा जाता है। क्रिप्टोग्राफिक हैश फ़ंक्शन क्रिप्टोग्राफिक हैश फ़ंक्शन hash function का वह वर्ग है जिसे information-security applications के लिए आवश्यक सुरक्षा गुणों को ध्यान में रखकर बनाया जाता है। NIST के अनुसार cryptographic hash functions fixed-length output उत्पन्न करते हैं और उनके security strength का मूल्यांकन preimage resistance, second-preimage resistance तथा collision resistance जैसे गुणों से किया जाता है। Cryptographic hash functions का उपयोग अकेले तथा अन्य cryptographic algorithms के घटक के रूप में किया जा सकता है। NIST के अनुसार hash functions digital signatures, message authentication codes, key derivation और अन्य security applications में उपयोग किए जाते हैं।FIPS 202: SHA-3 Standard, NIST. प्रमुख हैश एल्गोरिदम MD5 MD5 एक पुराना cryptographic hash algorithm है जो 128-bit message digest उत्पन्न करता है। इसके विरुद्ध व्यावहारिक collision attacks प्रदर्शित किए जा चुके हैं, इसलिए आधुनिक security applications में इसे collision-resistant cryptographic hash के रूप में उपयोग नहीं किया जाना चाहिए। इसके बजाय आधुनिक applications में SHA-2 या SHA-3 जैसे अधिक सुरक्षित algorithms का उपयोग किया जाता है। NIST ने collision resistance की आवश्यकता वाले applications के लिए SHA-1 से हटने और SHA-2 family का उपयोग करने की नीति अपनाई है।NIST Policy on Hash Functions, NIST. SHA-1 SHA-1 एक cryptographic hash algorithm है जो 160-bit message digest उत्पन्न करता है। इसे पहले व्यापक रूप से digital signatures और अन्य security applications में उपयोग किया जाता था। हालाँकि SHA-1 के विरुद्ध collision attacks सफलतापूर्वक प्रदर्शित किए जा चुके हैं। NIST collision resistance की आवश्यकता वाले नए applications में SHA-1 के स्थान पर SHA-2 या SHA-3 जैसे आधुनिक algorithms का उपयोग करने की सलाह देता है।Hash Functions, NIST. SHA-2 SHA-2 cryptographic hash algorithms का एक परिवार है। FIPS 180-4 में SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 और SHA-512/256 निर्दिष्ट किए गए हैं। इन algorithms में अलग-अलग block sizes, word sizes और digest lengths होते हैं। उदाहरण के लिए SHA-256 का message digest 256 bits का होता है, जबकि SHA-512 का digest 512 bits का होता है। SHA-2 family का उपयोग digital signatures, integrity mechanisms, authentication protocols और अन्य cryptographic applications में व्यापक रूप से किया जाता है। SHA-3 SHA-3 NIST द्वारा FIPS 202 में निर्दिष्ट cryptographic hash family है। इसे Keccak algorithm के आधार पर विकसित किया गया और यह SHA-2 से अलग internal construction का उपयोग करती है। SHA-3 family में निम्न fixed-length hash functions शामिल हैं: SHA3-224 SHA3-256 SHA3-384 SHA3-512 FIPS 202 में SHAKE128 और SHAKE256 नामक extendable-output functions (XOFs) भी निर्दिष्ट हैं। ये सामान्य fixed-length hash functions से अलग हैं क्योंकि इनके output की लंबाई application के अनुसार निर्धारित की जा सकती है। NIST के अनुसार SHA-3 family, SHA-2 family के लिए एक वैकल्पिक cryptographic construction उपलब्ध कराती है। वर्तमान में SHA-2 से SHA-3 में सामान्य अनिवार्य migration की आवश्यकता NIST ने नहीं बताई है। हैश फ़ंक्शन और डेटा अखंडता Hash values का उपयोग यह जाँचने के लिए किया जा सकता है कि किसी data object की सामग्री बदल गई है या नहीं। यदि किसी फ़ाइल का hash पहले से ज्ञात है, तो फ़ाइल को दोबारा hash करके दोनों values की तुलना की जा सकती है। यदि values अलग हैं, तो data में परिवर्तन हुआ हो सकता है। NIST Secure Hash Standard बताता है कि message में परिवर्तन होने पर उच्च संभावना के साथ अलग message digest प्राप्त होता है। हालाँकि केवल hash value की तुलना करना अपने आप में authenticity सिद्ध नहीं करता। यदि attacker मूल फ़ाइल और उसके साथ hash value दोनों बदल सकता है, तो वह नया hash भी उपलब्ध करा सकता है। Authentication के लिए digital signatures या keyed constructions जैसे अतिरिक्त cryptographic mechanisms की आवश्यकता हो सकती है। डिजिटल हस्ताक्षर Cryptographic hash functions डिजिटल हस्ताक्षर प्रणालियों में महत्वपूर्ण भूमिका निभाते हैं। बड़े message को सीधे public-key signature algorithm से process करने के बजाय उसका hash लेकर उस digest पर signature operation किया जा सकता है। प्राप्तकर्ता message का hash दोबारा निकालकर signature verification में उपयोग कर सकता है। यदि message बदल गया है, तो उसका digest बदलने के कारण verification विफल हो सकती है। NIST Secure Hash Standard hash functions के digital signatures और message authentication codes में उपयोग को निर्दिष्ट करता है। पासवर्ड और हैश फ़ंक्शन Hash functions का उपयोग password-related systems में भी किया जाता है, लेकिन सामान्य cryptographic hash जैसे SHA-256 को सीधे password storage के लिए उपयोग करना उचित नहीं माना जाता। Passwords के लिए विशेष password hashing या key-derivation algorithms का उपयोग किया जाता है जिनमें computational cost और अन्य सुरक्षा parameters नियंत्रित किए जा सकते हैं। इसका कारण यह है कि सामान्य hash algorithms बहुत तेज़ी से hash निकालने के लिए बनाए जाते हैं, जबकि password hashing में brute-force और dictionary attacks को महँगा बनाना वांछनीय होता है। इसलिए किसी password को केवल साधारण SHA-256 hash में बदलकर database में रखना password-storage का पूर्ण सुरक्षा समाधान नहीं है। हैश तालिका हैश तालिका (hash table) एक डेटा संरचना है जो key को एक hash value के माध्यम से किसी storage location या bucket से जोड़ती है। इसका उद्देश्य key-value data को तेज़ी से खोजने, जोड़ने और हटाने में सहायता करना है। हैश तालिका में सामान्य hash function और cryptographic hash function के उद्देश्य अलग होते हैं। सामान्य hash table के लिए speed, distribution और collision handling महत्वपूर्ण हो सकते हैं, जबकि cryptographic hash function के लिए security properties प्राथमिक होती हैं। हैश तालिका में दो अलग keys के समान hash value प्राप्त करने को भी collision कहा जाता है। इसे संभालने के लिए chaining और open addressing जैसी तकनीकों का उपयोग किया जा सकता है। हैश फ़ंक्शन और एन्क्रिप्शन में अंतर Hashing और एन्क्रिप्शन एक ही प्रक्रिया नहीं हैं। विशेषता हैशिंग एन्क्रिप्शन उद्देश्य डेटा का fixed-length digest बनाना डेटा को इस प्रकार बदलना कि अधिकृत पक्ष उसे decrypt कर सके सामान्य दिशा एक-दिशीय cryptographic use दो-दिशीय प्रक्रिया आउटपुट निर्धारित लंबाई का digest ciphertext मूल डेटा पुनर्प्राप्ति hash से मूल input निकालना computationally infeasible होना अपेक्षित सही key के साथ मूल plaintext प्राप्त किया जा सकता है प्रमुख उपयोग integrity, signatures, authentication आदि confidentiality Cryptographic hash functions का मुख्य उद्देश्य confidentiality प्रदान करना नहीं है। यदि किसी application को data को छिपाना है ताकि authorized party बाद में उसे वापस प्राप्त कर सके, तो encryption उपयुक्त cryptographic mechanism है। Collision Hash function का output fixed length होने के कारण theoretically collisions संभव हैं। यदि दो अलग inputs \(x\) और \(y\) के लिए हो, तो इसे collision कहा जाता है। किसी cryptographic hash function का security goal यह नहीं है कि collision गणितीय रूप से असंभव हो; बल्कि यह है कि computational resources की व्यावहारिक सीमाओं के भीतर useful collision ढूँढ़ना infeasible हो। Hash output की लंबाई बढ़ने पर सामान्य collision-search attacks के विरुद्ध theoretical security भी बढ़ सकती है, लेकिन वास्तविक सुरक्षा algorithm की पूरी construction और attack techniques पर निर्भर करती है। हैश फ़ंक्शन की सीमाएँ Hash function के उपयोग में कुछ महत्वपूर्ण सीमाएँ हैं: Hash value मूल data का reversible encoding नहीं है। Fixed-length output के कारण collisions सैद्धांतिक रूप से संभव हैं। किसी पुराने या कमजोर algorithm का उपयोग security risk पैदा कर सकता है। Hash value अकेले authenticity की गारंटी नहीं देती। Password storage के लिए सामान्य तेज़ hash functions उपयुक्त नहीं होते। Security-sensitive applications में algorithm का चुनाव application और threat model के अनुसार किया जाना चाहिए। NIST ने collision resistance की आवश्यकता वाले नए applications में SHA-1 से हटने तथा SHA-2 और SHA-3 जैसे आधुनिक hash algorithms के उपयोग की दिशा में guidance दी है। आधुनिक उपयोग Hash functions आधुनिक computing और information security में अनेक स्थानों पर उपयोग किए जाते हैं, जिनमें शामिल हैं: डेटा और फ़ाइलों की integrity जाँच; digital signatures; message authentication codes; key derivation; cryptographic protocols; password-related systems; hash tables और अन्य data structures; software तथा firmware verification; digital forensics; distributed systems और content-addressed storage। NIST hash functions को digital signatures, message authentication codes, key derivation और pseudorandom bit generation सहित अनेक security applications का घटक बताता है। SHA-2 और SHA-3 की तुलना विशेषता SHA-2 SHA-3 मानक FIPS 180-4 FIPS 202 प्रमुख निर्माण SHA-2 family construction Keccak आधारित permutation construction उपलब्ध fixed outputs 224, 256, 384 और 512 bits सहित 224, 256, 384 और 512 bits XOF नहीं SHAKE128 और SHAKE256 उपयोग सामान्य cryptographic hashing सामान्य cryptographic hashing तथा वैकल्पिक construction SHA-2 algorithms FIPS 180-4 में और SHA-3 family FIPS 202 में निर्दिष्ट हैं। महत्व हैश फ़ंक्शन computer science और information security दोनों में महत्वपूर्ण भूमिका निभाते हैं। सामान्य hash functions data structures में तेज़ indexing और lookup के लिए उपयोगी हैं, जबकि cryptographic hash functions data integrity, digital signatures और authentication जैसे security mechanisms का आधार प्रदान करते हैं। SHA-2 और SHA-3 जैसी standardized cryptographic hash families ने विभिन्न security applications के लिए व्यापक रूप से स्वीकार किए गए algorithms उपलब्ध कराए हैं। हालाँकि किसी application में hash function का चयन केवल algorithm के नाम के आधार पर नहीं किया जाना चाहिए। आवश्यक security properties, attack model, performance, interoperability और संबंधित cryptographic protocol को ध्यान में रखना आवश्यक है। यह भी देखें क्रिप्टोग्राफिक हैश फ़ंक्शन क्रिप्टोग्राफी एन्क्रिप्शन डिजिटल हस्ताक्षर हैश तालिका SHA-1 SHA-2 SHA-3 MD5 Keccak HMAC संदेश प्रमाणीकरण कोड संदर्भ