Sunday, February 3, 2008

Encryption

Symmetric-key vs. assymentric-key encryption (a.k.a. private-key and public-key encryption, respectively) have in common that in order to decode an encrypted message, one needs a certain "key." This key is a large number, often hundreds of bits long. In private-key encryption, the same key is used to encode and decode the message. Thus, it must be distributed to all parties involved in the communication beforehand and then kept secret. In many situations, distributing the key securely is a problem. This algorithm works best if the parties have some secure way to distribute a key once, and wish to communicate many times using the same key. If the secret key is somehow found out, then everyone must switch to a new key.

Public key encryption uses two keys: one to encrypt and one to decrypt. Each party has a public key (which they advertise) and their own private key (which must be kept secret). These keys are generated together, and the algorithm relies on using them both together. The math (which I don't completely understand) involves relative primeness of numbers and modular arithmetic. If someone wishes to communicate with me, they use my public key to encode a message, which I can then decode using my private key. Also, I can "digitally sign" things with my private key to prove my identity to people who know my public key. This algorithm is good for one-time communications but slower than symmetric-key encryption, and is very difficult to crack because finding out the keys involves factoring large numbers, which is (currently) a hard problem.

1 comment:

Andrea said...

Superb ! I was looking for this detail that will help me in knowing the exact point of difference between both these techniques. After learning all about it I wanted to know which is the best form of encryption.
what is a digital signature