Wednesday 19 November 2008

Cryptography

There are two type of cryptography
1. Symmetric
2. Asymmetric (Public key encryption)

Symmetric
Two major algorthims are
1. Data Encryption Standard (DES)
2. Advanced Encryption Standard (AES)

Main Components of Symmetric Cryptography
  1. Plaintext (P): The original message 
  2. Encryption algorithm (EA):  Performs a complex combination of substitutions/transpositions
  3. Secret Key (K): Controls substitutions/transpositions of plaintext
  4. Ciphertext (C): The scrambled message C = EA(P,K)
  5. Decryption algorithm (DA): Retrieves the original message P = DA(C, K)

Two general ways of attacking symmetric algorithms:
1. Cryptanalysis
  • Relies on some knowledge of the algorithm, P, or even sample P-C pairs
  • Uses algorithms characteristics (weaknesses) to deduce P or K
2. Brute-force
  • Uses every possible K on C until P is obtained
  • On average, half of all possible keys must be tried before success

Asymetric  (Public key encryption and Digital Signature)

First proposed by Diffie and Hellman in the late 70s
Based on mathematical operations and not on simple bit operations
It is asymmetric, i.e., there is a public key (Kpub) and a private key (Kpri)
Entities advertise their Kpub in yellow pages but keep their Kpri secret
P = Plaintext and C = Ciphertext
The encryption and decryption algorithms E are identical
The public and private keys are different but related; either of the two can be used for encryption, with the other used for decryption.
It is computationally infeasible to determine the decryption key given only the encryption key and the knowledge of the encryption algorithm

Main mathematical properties:
1. C = E (P, Kpub) and P = E (C, Kpri)
2. C = E (P, Kpri) and P = E (C, Kpub)
Data Communications and Networking http://www.sju.edu/~bforoura/courses/lectures/stallings2004/chap16.html

RSA was first developed by MIT scientists Rivest, Shamir and Adleman in 1977
It is the industry standard for public-key encryption
A block cipher where P and C are integers between 0 and n-1 for some n
The basic idea:
C = Pe mod n
P = Cd mod n = (Pe)d = Ped mod n

Sender and receiver know n and e but only the receiver knows d
The keys are:
Kpub = {e, n}
Kpri = {d, n}
General requirements:
It's possible to find e, d and n such that Ped = P mod n for P <>
It's easy to calculate Pe and Cd for P <>
It's computationally infeasible to determine d given e and n