| Line 7: |
Line 7: |
| | ==Diffie-Hellman key exchange protocol== | | ==Diffie-Hellman key exchange protocol== |
| | This is a method to secure a channel from eavesdroppers, by agreeing on an encryption key. It is used to let 2 parties agree on a key to be used for encrypting their communications, without actually transmitting said key on the channel between them. If somebody is eavesdropping he will not be able to deduce the key agreed upon from listening to the data. | | This is a method to secure a channel from eavesdroppers, by agreeing on an encryption key. It is used to let 2 parties agree on a key to be used for encrypting their communications, without actually transmitting said key on the channel between them. If somebody is eavesdropping he will not be able to deduce the key agreed upon from listening to the data. |
| − |
| |
| − | The main problem is the "man in the middle attack". Instead of merely eavesdropping, an attacker would place himself between the 2 parties trying to communicate, and he would participate in the key exchange. The spy would agree on one key with the first party, agree on another key with the second party. Then he is able to decrypt (and re-encrypt and retransmit) the data sent over the channel.
| |
| − |
| |
| − | However the protocol is useful because it raises the difficulty of eavesdropping. A spy would have to be able to place himself "in between" the two parties he intends to spy on. Also, the spy needs to actively participate in the conversation in order to be able to spy. If he were to put a listening device on the cable, for example, he would not be able to understand the messages sent.
| |
| | | | |
| | "Diffie-Hellman key exchange", relies on the fundamental [[hardness|difficulty]] of [[computing]] the discrete logarithm of a number in the [[Group (mathematics)|group]] ''G''. It was invented by [[Whitfield Diffie]] and Martin Hellman in 1976. The protocol proceeds in three steps: | | "Diffie-Hellman key exchange", relies on the fundamental [[hardness|difficulty]] of [[computing]] the discrete logarithm of a number in the [[Group (mathematics)|group]] ''G''. It was invented by [[Whitfield Diffie]] and Martin Hellman in 1976. The protocol proceeds in three steps: |
| Line 33: |
Line 29: |
| | | | |
| | By increasing p, the procedure of looking for a can be made arbitrarily difficult. These days p is generally chosen to be "relatively large", meaning that it should require "a bit less" than 256 bits to represent. Determining a would take on average 2<sup>255</sup> steps (although some algorithms can do it in slightly less steps) to determine a. | | By increasing p, the procedure of looking for a can be made arbitrarily difficult. These days p is generally chosen to be "relatively large", meaning that it should require "a bit less" than 256 bits to represent. Determining a would take on average 2<sup>255</sup> steps (although some algorithms can do it in slightly less steps) to determine a. |
| | + | |
| | + | The main problem is the "man in the middle attack". Instead of merely eavesdropping, an attacker would place himself between the 2 parties trying to communicate, and he would participate in the key exchange. The spy would agree on one key with the first party, agree on another key with the second party. Then he is able to decrypt (and re-encrypt and retransmit) the data sent over the channel. |
| | + | |
| | + | However the protocol is useful because it raises the difficulty of eavesdropping. A spy would have to be able to place himself "in between" the two parties he intends to spy on. Also, the spy needs to actively participate in the conversation in order to be able to spy. If he were to put a listening device on the cable, for example, he would not be able to understand the messages sent. |
| | | | |
| | ==RSA encryption== | | ==RSA encryption== |
| Line 42: |
Line 42: |
| | | | |
| | ==GCHQ== | | ==GCHQ== |
| − | The mathematics of public key cryptography, and specifically RSA, are now generally recognized to have been first developed at the British government signals intelligence department [[GCHQ]] (Government Communications Headquarters). In 1975 three mathematicians at GCHQ, James Ellis, Clifford Cocks and Malcolm Williamson devised the mathematics for a public key system. However, due the limited computing power available at the time, the idea was not developed into a practical system, and due to the secret nature of the established, papers on the subject were not released to the general mathematical community. The discoveries of Rivest, Shamir and Adelman, although later, were entirely independent.<ref>http://www.bbc.co.uk/news/uk-england-gloucestershire-11475101</ref> | + | The mathematics of public key cryptography, and specifically RSA, are now generally recognized to have been first developed at the British government signals intelligence department [[GCHQ]] (Government Communications Headquarters). In 1975 three mathematicians at GCHQ, James Ellis, Clifford Cocks and Malcolm Williamson devised the mathematics for a public key system. However, due the limited computing power available at the time, the idea was not developed into a practical system, and due to the secret nature of the established, papers on the subject were not released to the general mathematical community. The discoveries of Rivest, Shamir and Adelman, although later, were entirely independent.<ref>https://www.bbc.co.uk/news/uk-england-gloucestershire-11475101</ref> |
| | | | |
| | ==Example== | | ==Example== |
| Line 50: |
Line 50: |
| | * Fred '''encrypts''' the message using his ''private key''. (only fred knows this key) | | * Fred '''encrypts''' the message using his ''private key''. (only fred knows this key) |
| | * Fred sends the encrypted message | | * Fred sends the encrypted message |
| − | * George gets the message (others may as well,but that is not important) | + | * George gets the message (others may as well, but that is not important) |
| | * George '''decrypts''' the message using Fred's ''Public key''. | | * George '''decrypts''' the message using Fred's ''Public key''. |
| | * Only a message coded with the private key can be decoded with the public key so George knows it came from Fred. | | * Only a message coded with the private key can be decoded with the public key so George knows it came from Fred. |
| Line 58: |
Line 58: |
| | * Only Fred's ''private key'' can '''decrypt''' the message, so it is secure | | * Only Fred's ''private key'' can '''decrypt''' the message, so it is secure |
| | * Fred receives the message and decrypts it | | * Fred receives the message and decrypts it |
| − | * It's a valid message but Fred can't know who sent it, anyone with the public key could send to him. For this reason, George may encrypt the message with his private key as well as Fred's public key, to prove it came from George while ensure only Fred can read it. | + | * It's a valid message but Fred can't know who sent it, anyone with the public key could send to him. For this reason, George may encrypt the message with his private key as well as Fred's public key, to prove it came from George while ensuring that only Fred can read it. |
| − | | |
| − | This form of public key encryption works best with sets of private and public keys.
| |
| | | | |
| | ==References== | | ==References== |