आर्गन2

From Vigyanwiki

आर्गन2 एक प्रमुख व्युत्पत्ति कार्य है जिसे 2015 पासवर्ड हैशिंग प्रतियोगिता के विजेता के रूप में चुना गया था।[1][2] यह लक्समबर्ग विश्वविद्यालय से एलेक्स बिरुकोव, डैनियल दीनू और दिमित्री खोवराटोविच द्वारा डिजाइन किया गया था।[3] आर्गन2 का संदर्भ कार्यान्वयन क्रिएटिव  कॉमन्स CC0 लाइसेंस (यानी पब्लिक डोमेन) या अपाचे लाइसेंस 2.0 के तहत जारी किया गया है, और तीन संबंधित संस्करण प्रदान करता है:

  • आर्गन2d GPU पासवर्ड क्रैकिंग के प्रतिरोध को अधिकतम करता है। यह एक पासवर्ड निर्भर क्रम में मेमोरी ऐरे को एक्सेस करता है, जो टाइम-मेमोरी ट्रेड-ऑफ (टीएमटीओ) अटैक्स की संभावना को कम करता है, लेकिन संभावित साइड-चैनल अटैक का परिचय देता है।
  • आर्गन2i को साइड-चैनल अटैक्स का विरोध करने के लिए अनुकूलित किया गया है। यह एक पासवर्ड स्वतंत्र क्रम में मेमोरी ऐरे को एक्सेस करता है।
  • आर्गन2id एक संकर (हाइब्रिड) संस्करण है। यह पहली छमाही पास ओवर मेमोरी के लिए आर्गन2i दृष्टिकोण और बाद के पास के लिए आर्गन2d दृष्टिकोण का अनुसरण करता है। RFC 9106 आर्गन2id का उपयोग करने की अनुशंसा करता है यदि आप प्रकारों के बीच अंतर नहीं जानते हैं या आप साइड-चैनल अटैक को एक व्यवहार्य खतरा मानते हैं।[4]

सभी तीन मोड तीन मापदंडों द्वारा विनिर्देशन की अनुमति देते हैं जो नियंत्रित करते हैं:

  • निष्पादन समय
  • आवश्यक मेमोरी
  • समानता की डिग्री

क्रिप्टैनालिसिस

अटैक जबकि आर्गन2d के लिए कोई सार्वजनिक क्रिप्ट विश्लेषण लागू नहीं है, आर्गन2i फ़ंक्शन पर दो प्रकाशित अटैक हैं। पहला अटैक केवल आर्गन2i के पुराने संस्करण पर लागू होता है, जबकि दूसरा नवीनतम संस्करण (1.3) तक बढ़ा दिया गया है।[5]

पहले अटैक से पता चलता है कि वांछित स्थान के एक चौथाई और पांचवे हिस्से के बीच बिना किसी समय दंड के एकल-पास आर्गन2i फ़ंक्शन की गणना करना संभव है, और केवल N/e (≈ N/2.72) का उपयोग करके एक बहु-पास आर्गन2i की गणना करना संभव है, स्थान और बिना किसी समय दंड (पेनाल्टी) के।[6] आर्गन2 लेखकों के अनुसार, यह अटैक वेक्टर संस्करण 1.3 में तय किया गया था।[7]

दूसरे अटैक से पता चलता है कि आर्गन2i की गणना एक एल्गोरिथ्म द्वारा की जा सकती है जिसमें जटिलता O(n7/4 लॉग (n)) मापदंडों के सभी विकल्पों के लिए σ (अंतरिक्ष लागत), τ (समय की लागत), और थ्रेड-काउंट जैसे कि n=στ.[8] आर्गन2 लेखकों का दावा है कि यदि आर्गन2i का उपयोग तीन या अधिक पास के साथ किया जाता है तो यह अटैक कुशल नहीं है।[7]हालांकि, जोएल अल्वेन और यिर्मयाह ब्लॉकी ने अटैक में सुधार किया और दिखाया कि अटैक को विफल करने के लिए, आर्गन2i v1.3 को मेमोरी पर 10 से अधिक पास की जरूरत है।[5]

एल्गोरिथम

Function Argon2

   Inputs:
      password (P):       Bytes (0..232-1)    Password (or message) to be hashed
      salt (S):           Bytes (8..232-1)    Salt (16 bytes recommended for password hashing)
      parallelism (p):    Number (1..224-1)   Degree of parallelism (i.e. number of threads)
      tagLength (T):      Number (4..232-1)   Desired number of returned bytes
      memorySizeKB (m):   Number (8p..232-1)  Amount of memory (in kibibytes) to use
      iterations (t):     Number (1..232-1)   Number of iterations to perform
      version (v):        Number (0x13)       The current version is 0x13 (19 decimal)
      key (K):            Bytes (0..232-1)    Optional key (Errata: PDF says 0..32 bytes, RFC says 0..232 bytes)
      associatedData (X): Bytes (0..232-1)    Optional arbitrary extra data
      hashType (y):       Number (0=Argon2d, 1=Argon2i, 2=Argon2id)
   Output:
      tag:                Bytes (tagLength)   The resulting generated bytes, tagLength bytes long

   Generate initial 64-byte block H0.
    All the input parameters are concatenated and input as a source of additional entropy.
    Errata: RFC says H0 is 64-bits; PDF says H0 is 64-bytes.
    Errata: RFC says the Hash is H^, the PDF says it's ℋ (but doesn't document what ℋ is). It's actually Blake2b.
    Variable length items are prepended with their length as 32-bit little-endian integers.
   buffer ← parallelism ∥ tagLength ∥ memorySizeKB ∥ iterations ∥ version ∥ hashType
         ∥ Length(password)       ∥ Password
         ∥ Length(salt)           ∥ salt
         ∥ Length(key)            ∥ key
         ∥ Length(associatedData) ∥ associatedData
   H0 ← Blake2b(buffer, 64) //default hash size of Blake2b is 64-bytes

   Calculate number of 1 KB blocks by rounding down memorySizeKB to the nearest multiple of 4*parallelism kibibytes
   blockCount ← Floor(memorySizeKB, 4*parallelism)

   Allocate two-dimensional array of 1 KiB blocks (parallelism rows x columnCount columns)
   columnCount ← blockCount / parallelism;   //In the RFC, columnCount is referred to as q

   Compute the first and second block (i.e. column zero and one ) of each lane (i.e. row)
   for i ← 0 to parallelism-1 do for each row
      Bi[0] ← Hash(H0 ∥ 0 ∥ i, 1024) //Generate a 1024-byte digest
      Bi[1] ← Hash(H0 ∥ 1 ∥ i, 1024) //Generate a 1024-byte digest

   Compute remaining columns of each lane
   for i ← 0 to parallelism-1 do //for each row
      for j ← 2 to columnCount-1 do //for each subsequent column
         //i' and j' indexes depend if it's Argon2i, Argon2d, or Argon2id (See section 3.4)
         i′, j′ ← GetBlockIndexes(i, j)  //the GetBlockIndexes function is not defined
         Bi[j] = G(Bi[j-1], Bi′[j′]) //the G hash function is not defined

   Further passes when iterations > 1
   for nIteration ← 2 to iterations do
      for i ← 0 to parallelism-1 do for each row
        for j ← 0 to columnCount-1 do //for each subsequent column
           //i' and j' indexes depend if it's Argon2i, Argon2d, or Argon2id (See section 3.4)
           i′, j′ ← GetBlockIndexes(i, j)
           if j == 0 then 
             Bi[0] = Bi[0] xor G(Bi[columnCount-1], Bi′[j′])
           else
             Bi[j] = Bi[j] xor G(Bi[j-1], Bi′[j′])

   Compute final block C as the XOR of the last column of each row
   C ← B0[columnCount-1]
   for i ← 1 to parallelism-1 do
      C ← C xor Bi[columnCount-1]

   Compute output tag
   return Hash(C, tagLength)

Variable-length hash function

Argon2 makes use of a hash function capable of producing digests up to 232 bytes long. This hash function is internally built upon Blake2.

Function Hash(message, digestSize)
   Inputs:
      message:         Bytes (0..232-1)     Message to be hashed
      digestSize:      Integer (1..232)     Desired number of bytes to be returned
   Output:
      digest:          Bytes (digestSize)   The resulting generated bytes, digestSize bytes long

   Hash is a variable-length hash function, built using Blake2b, capable of generating
   digests up to 232 bytes.

   If the requested digestSize is 64-bytes or lower, then we use Blake2b directly
   if (digestSize <= 64) then
      return Blake2b(digestSize ∥ message, digestSize) //concatenate 32-bit little endian digestSize with the message bytes

   For desired hashes over 64-bytes (e.g. 1024 bytes for Argon2 blocks),
   we use Blake2b to generate twice the number of needed 64-byte blocks,
   and then only use 32-bytes from each block

   Calculate the number of whole blocks (knowing we're only going to use 32-bytes from each)
   r ← Ceil(digestSize/32)-2;

   Generate r whole blocks.
   Initial block is generated from message
   V1 ← Blake2b(digestSize ∥ message, 64);
   Subsequent blocks are generated from previous blocks
   for i ← 2 to r do
      Vi ← Blake2b(Vi-1, 64)
   Generate the final (possibly partial) block
   partialBytesNeeded ← digestSize – 32*r;
   Vr+1 ← Blake2b(Vr, partialBytesNeeded)

   Concatenate the first 32-bytes of each block Vi
   (except the possibly partial last block, which we take the whole thing)
   Let Ai represent the lower 32-bytes of block Vi
   return A1 ∥ A2 ∥ ... ∥ Ar ∥ Vr+1

संदर्भ

  1. "Password Hashing Competition"
  2. Jos Wetzels (2016-02-08). "Open Sesame: The Password Hashing Competition and Argon2". arXiv:1602.03097 [cs.CR].
  3. Argon2: the memory-hard function for password hashing and other applications, Alex Biryukov, et al, October 1, 2015
  4. "Argon2 Memory-Hard Function for Password Hashing and Proof-of-Work Applications". Retrieved September 9, 2021.
  5. 5.0 5.1 Joël Alwen; Jeremiah Blocki (2016-08-05). Towards Practical Attacks on Argon2i and Balloon Hashing (PDF) (Report).
  6. Henry; Corrigan-Gibbs; Dan Boneh; Stuart Schechter (2016-01-14). Balloon Hashing: Provably Space-Hard Hash Functions with Data-Independent Access Patterns (PDF) (Report).
  7. 7.0 7.1 "[Cfrg] Argon2 v.1.3". www.ietf.org. Retrieved 2016-10-30.
  8. Joël Alwen; Jeremiah Blocki (2016-02-19). कुशल रूप से डेटा-स्वतंत्र मेमोरी-हार्ड फ़ंक्शंस की गणना करना (PDF) (Report).

बाहरी संबंध