miércoles, 5 de septiembre de 2012

Diffie-Hellman Key Exchange


The Diffie-Hellman key agreement protocol (1976) was the first practical method for establishing a shared secret over an unsecured communication channel. 

The point is to agree on a key that two parties can use for a symmetric encryption, in such a way that an eavesdropper cannot obtain the key.



Steps in the algorithm:

  1. Alice and Bob agree on a prime number and a base g.
  2. Alice chooses a secret number xand sends Bob (gxmod p)
  3.  Bob chooses a secret number y, and sends Alice (gymod p)
  4.  Alice computes ((gymod p)mod p).
  5. Bob computes ((gmod p)mod p).
Example:
  1. Alicea nd Bob agree on p=23 and g=5.
  2. Alice chooses a=6 and sends 56 mod23=8
  3. Bob chooses b = 15 and sends 515 mod 23 = 19.
  4. Alice computes 196 mod 23 = 2.
  5. Bob computes 815 mod 23 = 2 

But it is not only sufficiently large values ​​of the exponents that give security to this system. The choice of gyn also has a marked influence. The modulus n must be a prime number and, more important than this, (n-1) / 2 must also be a prime number. The base g, on the other hand, must be a primitive root modulo n in (more on the matter immediately below). Now, the most important of all is that n should be large, there is at least 512 bits

Hack alice and Bob Manually

Hack used Program in python


CrypTool was implemented to generate prime numbers and by Teorama of Fermat's theorem was verified whether conditions met some adjustments were made to the generator g, code was also implemented to brute force attacks

---------



1 comentario:

  1. "algarisms though" o_0 ¿qué es eso? la ortografía podría ser mejor y no en realidad necesitas trabajar con números tan grandes; usa más el módulo; van 7

    ResponderEliminar