Chapter 3:-MODERN CRYPTOGRAPHY

Modern Cryptography Algorithm

*The encryption algorithm may act on a bit-string in a number of ways.
-stream ciphers where the sequence is encrypted bit-by-bit.
-block ciphers, where the sequence is divided into blocks of a predetermined size.
-ASCII requires 8 bits to represent one character, and so for a block cipher that has 64-bit blocks, the encryption algorithm acts on eight characters at once.
*Since most modern algorithms operate on binary strings we need to be familiar with a method of combining two bits called Exclusive OR and often written as XOR or .
0  0 = 0, 0  1 =1,
1  0 = 1 and 1  1 = 0

#Stream ciphers
-they convert one symbol of plaintext immediately into a symbol of ciphertext
-depends on symbol, key and control information of encipherment algorithm


#Block ciphers
-encrypt a group of plaintext symbols as one block
-examples are transposition ciphers
e.g, in columnar transposition, the entire message is translated as one block, block size need not have any particular relationship to the size of the character


**DES Cryptography is a 64 bits Symmetric Key Algorithm. Initially, IBM developed 128 bit algorithm called "Lucifer".


**Later, NSA modified the algorithm and named the algorithm as DEA (Data Encryption Algorithm) and the Standard is known as DES.


DES Cryptography Basics
DES is a,
-64 bit,
-Symmetric Key,
- Block Cipher,
-Performing 16 rounds of Transposition and Substitution.


Typical steps of DES Encryption Process:


Step 1: Divide the message into 64 bit size blocks.
Step 2: Take one block at a time.
Step 3: Perform 16 rounds of transposition and substitution.
DES Key determines the order and type of the Transposition and Substitution functions.


DES Modes of Operation


There are different modes of operation. Let's see few of them.


1. Electronic Code book
2. Cipher block chaining
3. Cipher Feedback
4. Output Feedback


DES - Electronic Code Book





The picture shows exact functioning of the ECB mode
1. Same Key is used to encrypt all the (64 bits) blocks.
2. The key determines the order and type of Substitution and Transposition functions.
3. Suitable only for encrypting small messages.
4. Can be used to encrypt specific fields in the database.
5. This mode is faster than other DES modes. Because each block is encrypted independently.
6. Not suitable for Large messages as it uses same key for all blocks. Hackers may identify the Key easily using Frequency Analysis.


DES - Cipher Block Chaining
1. Divide the message into 64 bits block.
2. Use 64 bit Initialization Vector to modify (XOR) the first block.
3. Encrypt the first block using the Substitution and Transposition functions as specified in the Key.
4. Use the first cipher block to modify (XOR) the Second block.
5. Repeat the procedure from step 3 for other blocks.
6. Suitable for encrypting Large messages.



DES Cryptography - Cipher Feedback Mode


1. Divide the message into 8 bits block.
2. Algorithm generates keystream, using the Initialization Vector and the Key.
3. Use the Keystream to Encrypt (XOR) the Plain text.
4. Use the resulting Cipher text to create a Key stream for the next block.
5. Suitable for encrypting Small messages.




RSA


RSA is an asymmetric algorithm named after its inventors,


1. Ron Rivest,
2. Adi Shamir,
3. Leonard Adleman
In cryptography, this standard is used for,


1. Signing (used in Digital Signatures)
2. Encryption, and
3. Key Exchange
-The logic used here is very interesting one. If you would like to read the algorithm with an example refer Wikipedia.
-The main disadvantage of this asymmetric algoritm is Low Speed. It's slower than the other encryption standards.
-It has been implemented in NICs, OS (Windows, Sun and Novell) and various applications.
-It is also included in some of the security protocols like,
1. SSL,
2. S/WAN, and
3. S/MIME


Scenario 1 - Digital Signature
In case of digital signature, the message integrity is assured using the message digest value produced using the hashing algorithm (SHA). Then the message digest is encrypted using the Private key.


Let's see how the documents are digitally signed using Encryption and SHA.
1. Message Authentication is assured by encrypting the hash value with the sender's private Key.
2. Integrity is verified using the message digest value.



 
 
Scenario 2 - Encryption
Let's assume Mr. A wants to send a confidential message to Mr. B. Mr. A has to encrypt the message with public key of Mr. B.
Let's see how this asymmetric key algorithm can be used to encrypt the message.


Scenario 3 - Encryption for Key distribution
Let's assume Mr. A wants to send a LARGE confidential message to Mr. B. Mr. A encrypted the message with some symmetric key, say, AES.



RSA Security
*possible approaches to attacking RSA are:
*brute force key search (infeasible given size of numbers)
*mathematical attacks (based on difficulty of computing ø(n), by factoring modulus n)
*timing attacks (on running of decryption)
*chosen ciphertext attacks (given properties of RSA

RSA Use
**to encrypt a message M the sender:
-obtains public key of recipient PU={e,n}
-computes: C = Me mod n
**to decrypt the ciphertext C the owner:
-uses their private key PR={d,n}
-computes: M = Cd mod n
**note that the message M must be smaller than the modulus n (block if needed)
Key Setup
  • Select primes: p=17 & q=11
  • Compute n = pq =17 x 11=187
  • Compute ø(n)=(p–1)(q-1)=16 x 10=160
  • Select e: gcd(e,160)=1; choose e=7
  • Determine d: de=1 mod 160 and d < 160 Value is d=23
  • Publish public key PU={7,187}
  • Keep secret private key PR={23,187}
En/Decryption
sample RSA encryption/decryption is:
-given message M = 88 (number 88<187)
-encryption:
C = Me mod n
C = 887 mod 187 = 11
-decryption:
M = Cd mod n
M = 1123 mod 187 = 88

Methods of Attack
*Four general attacks can be perform against encrypted information:
-Ciphertext-only attack:-guessing the plaintext or using frequency analysis
-Known Plaintext:-guess using known pliantext.
-Chosen-plaintext
-Chosen-ciphertext attack
*There are also specific attacks that can be launched against encryption systems.

-Brute-Force attack:-Exhaustive key search - trying every possible combination.
-Replay attacks:-Taking encrypted information and playing it back at a later point in time.
-Man-in-the-middle attacks
-Fault in Cryptosytem


1 comments:

Unknown said...

Great blog. I really appreciate the owner of this blog for sharing such an excellent detail about so many security concepts. Its a great help for everyone who is interested in learning about each of these terms. Keep posting more buddy.
digital certificates

Post a Comment