fbpx
Wikipedia

Baby-step giant-step

In group theory, a branch of mathematics, the baby-step giant-step is a meet-in-the-middle algorithm for computing the discrete logarithm or order of an element in a finite abelian group by Daniel Shanks.[1] The discrete log problem is of fundamental importance to the area of public key cryptography.

Many of the most commonly used cryptography systems are based on the assumption that the discrete log is extremely difficult to compute; the more difficult it is, the more security it provides a data transfer. One way to increase the difficulty of the discrete log problem is to base the cryptosystem on a larger group.

Theory edit

The algorithm is based on a space–time tradeoff. It is a fairly simple modification of trial multiplication, the naive method of finding discrete logarithms.

Given a cyclic group   of order  , a generator   of the group and a group element  , the problem is to find an integer   such that

 

The baby-step giant-step algorithm is based on rewriting  :

 
 
 
 

Therefore, we have:

 
 
 

The algorithm precomputes   for several values of  . Then it fixes an   and tries values of   in the right-hand side of the congruence above, in the manner of trial multiplication. It tests to see if the congruence is satisfied for any value of  , using the precomputed values of  .

The algorithm edit

Input: A cyclic group G of order n, having a generator α and an element β.

Output: A value x satisfying  .

  1. m ← Ceiling(n)
  2. For all j where 0 ≤ j < m:
    1. Compute αj and store the pair (j, αj) in a table. (See § In practice)
  3. Compute αm.
  4. γβ. (set γ = β)
  5. For all i where 0 ≤ i < m:
    1. Check to see if γ is the second component (αj) of any pair in the table.
    2. If so, return im + j.
    3. If not, γγαm.


In practice edit

The best way to speed up the baby-step giant-step algorithm is to use an efficient table lookup scheme. The best in this case is a hash table. The hashing is done on the second component, and to perform the check in step 1 of the main loop, γ is hashed and the resulting memory address checked. Since hash tables can retrieve and add elements in   time (constant time), this does not slow down the overall baby-step giant-step algorithm.

The space complexity of the algorithm is  , while the time complexity of the algorithm is  . This running time is better than the   running time of the naive brute force calculation.

The Baby-step giant-step algorithm could be used by an eavesdropper to derive the private key generated in the Diffie Hellman key exchange[citation needed], when the modulus is a prime number that is not too large. If the modulus is not prime, the Pohlig–Hellman algorithm has a smaller algorithmic complexity, and potentially solves the same problem.

Notes edit

  • The baby-step giant-step algorithm is a generic algorithm. It works for every finite cyclic group.
  • It is not necessary to know the order of the group G in advance. The algorithm still works if n is merely an upper bound on the group order.
  • Usually the baby-step giant-step algorithm is used for groups whose order is prime. If the order of the group is composite then the Pohlig–Hellman algorithm is more efficient.
  • The algorithm requires O(m) memory. It is possible to use less memory by choosing a smaller m in the first step of the algorithm. Doing so increases the running time, which then is O(n/m). Alternatively one can use Pollard's rho algorithm for logarithms, which has about the same running time as the baby-step giant-step algorithm, but only a small memory requirement.
  • While this algorithm is credited to Daniel Shanks, who published the 1971 paper in which it first appears, a 1994 paper by Nechaev[2] states that it was known to Gelfond in 1962.
  • There exist optimized versions of the original algorithm, such as using the collision-free truncated lookup tables of [3] or negation maps and Montgomery's simultaneous modular inversion as proposed in.[4]

Further reading edit

  • H. Cohen, A course in computational algebraic number theory, Springer, 1996.
  • D. Shanks, Class number, a theory of factorization and genera. In Proc. Symp. Pure Math. 20, pages 415—440. AMS, Providence, R.I., 1971.
  • A. Stein and E. Teske, Optimized baby step-giant step methods, Journal of the Ramanujan Mathematical Society 20 (2005), no. 1, 1–32.
  • A. V. Sutherland, Order computations in generic groups, PhD thesis, M.I.T., 2007.
  • D. C. Terr, A modification of Shanks’ baby-step giant-step algorithm, Mathematics of Computation 69 (2000), 767–773. doi:10.1090/S0025-5718-99-01141-2

References edit

  1. ^ Daniel Shanks (1971), "Class number, a theory of factorization and genera", In Proc. Symp. Pure Math., Providence, R.I.: American Mathematical Society, vol. 20, pp. 415–440
  2. ^ V. I. Nechaev, Complexity of a determinate algorithm for the discrete logarithm, Mathematical Notes, vol. 55, no. 2 1994 (165-172)
  3. ^ Panagiotis Chatzigiannis, Konstantinos Chalkias and Valeria Nikolaenko (2021-06-30). Homomorphic decryption in blockchains via compressed discrete-log lookup tables. CBT workshop 2021 (ESORICS). Retrieved 2021-09-07.
  4. ^ Steven D. Galbraith, Ping Wang and Fangguo Zhang (2016-02-10). Computing Elliptic Curve Discrete Logarithms with Improved Baby-step Giant-step Algorithm. Advances in Mathematics of Communications. Retrieved 2021-09-07.

External links edit

  • Baby step-Giant step – example C source code

baby, step, giant, step, group, theory, branch, mathematics, baby, step, giant, step, meet, middle, algorithm, computing, discrete, logarithm, order, element, finite, abelian, group, daniel, shanks, discrete, problem, fundamental, importance, area, public, cry. In group theory a branch of mathematics the baby step giant step is a meet in the middle algorithm for computing the discrete logarithm or order of an element in a finite abelian group by Daniel Shanks 1 The discrete log problem is of fundamental importance to the area of public key cryptography Many of the most commonly used cryptography systems are based on the assumption that the discrete log is extremely difficult to compute the more difficult it is the more security it provides a data transfer One way to increase the difficulty of the discrete log problem is to base the cryptosystem on a larger group Contents 1 Theory 2 The algorithm 3 In practice 4 Notes 5 Further reading 6 References 7 External linksTheory editThe algorithm is based on a space time tradeoff It is a fairly simple modification of trial multiplication the naive method of finding discrete logarithms Given a cyclic group G displaystyle G nbsp of order n displaystyle n nbsp a generator a displaystyle alpha nbsp of the group and a group element b displaystyle beta nbsp the problem is to find an integer x displaystyle x nbsp such that a x b displaystyle alpha x beta nbsp The baby step giant step algorithm is based on rewriting x displaystyle x nbsp x i m j displaystyle x im j nbsp m n displaystyle m left lceil sqrt n right rceil nbsp 0 i lt m displaystyle 0 leq i lt m nbsp 0 j lt m displaystyle 0 leq j lt m nbsp Therefore we have a x b displaystyle alpha x beta nbsp a i m j b displaystyle alpha im j beta nbsp a j b a m i displaystyle alpha j beta left alpha m right i nbsp The algorithm precomputes a j displaystyle alpha j nbsp for several values of j displaystyle j nbsp Then it fixes an m displaystyle m nbsp and tries values of i displaystyle i nbsp in the right hand side of the congruence above in the manner of trial multiplication It tests to see if the congruence is satisfied for any value of j displaystyle j nbsp using the precomputed values of a j displaystyle alpha j nbsp The algorithm editInput A cyclic group G of order n having a generator a and an element b Output A value x satisfying a x b displaystyle alpha x beta nbsp m Ceiling n For all j where 0 j lt m Compute aj and store the pair j aj in a table See In practice Compute a m g b set g b For all i where 0 i lt m Check to see if g is the second component aj of any pair in the table If so return im j If not g g a m In practice editThe best way to speed up the baby step giant step algorithm is to use an efficient table lookup scheme The best in this case is a hash table The hashing is done on the second component and to perform the check in step 1 of the main loop g is hashed and the resulting memory address checked Since hash tables can retrieve and add elements in O 1 displaystyle O 1 nbsp time constant time this does not slow down the overall baby step giant step algorithm The space complexity of the algorithm is O n displaystyle O sqrt n nbsp while the time complexity of the algorithm is O n displaystyle O sqrt n nbsp This running time is better than the O n displaystyle O n nbsp running time of the naive brute force calculation The Baby step giant step algorithm could be used by an eavesdropper to derive the private key generated in the Diffie Hellman key exchange citation needed when the modulus is a prime number that is not too large If the modulus is not prime the Pohlig Hellman algorithm has a smaller algorithmic complexity and potentially solves the same problem Notes editThe baby step giant step algorithm is a generic algorithm It works for every finite cyclic group It is not necessary to know the order of the group G in advance The algorithm still works if n is merely an upper bound on the group order Usually the baby step giant step algorithm is used for groups whose order is prime If the order of the group is composite then the Pohlig Hellman algorithm is more efficient The algorithm requires O m memory It is possible to use less memory by choosing a smaller m in the first step of the algorithm Doing so increases the running time which then is O n m Alternatively one can use Pollard s rho algorithm for logarithms which has about the same running time as the baby step giant step algorithm but only a small memory requirement While this algorithm is credited to Daniel Shanks who published the 1971 paper in which it first appears a 1994 paper by Nechaev 2 states that it was known to Gelfond in 1962 There exist optimized versions of the original algorithm such as using the collision free truncated lookup tables of 3 or negation maps and Montgomery s simultaneous modular inversion as proposed in 4 Further reading editH Cohen A course in computational algebraic number theory Springer 1996 D Shanks Class number a theory of factorization and genera In Proc Symp Pure Math 20 pages 415 440 AMS Providence R I 1971 A Stein and E Teske Optimized baby step giant step methods Journal of the Ramanujan Mathematical Society 20 2005 no 1 1 32 A V Sutherland Order computations in generic groups PhD thesis M I T 2007 D C Terr A modification of Shanks baby step giant step algorithm Mathematics of Computation 69 2000 767 773 doi 10 1090 S0025 5718 99 01141 2References edit Daniel Shanks 1971 Class number a theory of factorization and genera In Proc Symp Pure Math Providence R I American Mathematical Society vol 20 pp 415 440 V I Nechaev Complexity of a determinate algorithm for the discrete logarithm Mathematical Notes vol 55 no 2 1994 165 172 Panagiotis Chatzigiannis Konstantinos Chalkias and Valeria Nikolaenko 2021 06 30 Homomorphic decryption in blockchains via compressed discrete log lookup tables CBT workshop 2021 ESORICS Retrieved 2021 09 07 Steven D Galbraith Ping Wang and Fangguo Zhang 2016 02 10 Computing Elliptic Curve Discrete Logarithms with Improved Baby step Giant step Algorithm Advances in Mathematics of Communications Retrieved 2021 09 07 External links editBaby step Giant step example C source code Retrieved from https en wikipedia org w index php title Baby step giant step amp oldid 1181989996, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.