Cryptography

‘Cryptography’ is the ability to hide messages from intermediate persons and ensure effective and secure communication between different parties. ‘Cryptography’s’ origins can be traced back to 2000 B.C. Egypt (when hieroglyphics were used) and to the time of Julius Caesar where alphabets were shifted to encrypt a message. We also see various instances of cryptography in movies such as ‘The Da Vinci code’, ‘The Imitation game’, ‘Pi’, ‘Enigma’ among others.

We will see the two different types of encryption – symmetric and asymmetric algorithms and primarily focus our discussion on the symmetric algorithm.

Introduction:

The key terms that are associated with cryptographic systems are

  1. Plain text
  2. Cipher text
  3. Algorithm
  4. Key
  5. Encryption

 “Encryption” is converting “plain text” (or text that is ordinarily read by everybody) into “cipher text”.  “Cipher text” is text that is not readable by humans or machines.  Reconverting the “cipher text” into “plaintext” is “decryption”. The entire process of encryption and decryption is possible due to the “algorithm” and the “key”.

The “algorithm” is a set of rules which are complex mathematical formulae that enable encryption and decryption. Popular cryptographic algorithms include DES (Data encryption standard), AES (Advanced encryption standard) and MD5.

The “key” is a value that consists of random bits which is used for encryption and decryption.  The longer the key, the more difficult it will be for the attacker to guess the message.

Types of cryptography:

In asymmetric cryptography there are two keys – one is a public key and one is a private key to encrypt and decrypt.

Symmetric cryptography on the other hand is when both the sender and receiver use two instances of the same “key” (also known as “secret keys”) to encrypt and decrypt messages. In traditional parlance, if Bob and Alice were to communicate then, they need two instances of the same key.

There are two types of symmetric ciphers – substitution ciphers and transposition ciphers.

  1. Substitution ciphers:

In substitution ciphers, the alphabets in the plain text are replaced by shifting the alphabets ‘n’ number of places. For example, in the Caesar cipher, if this algorithm were followed,

ABCDEFGHIJKLMNOPQRSTUVWXYZ being replaced by:

CDEFGHIJKLMNOPQRSTUVWXYZAB

Plaintext:  WHIZLABS          will be replaced by

Cipher text: YKLBNCDU

In the above algorithm, the alphabets are shifted by ‘2’ places. The key is the number of places the alphabets are shifted (which is ‘2’ here)

This is the simplest implementation of the substitution cipher.

2. Transposition ciphers

In the transposition cipher, the letters are re-arranged in a way to mask the original message. The ‘rail fence cipher’ is a simple example of the transposition cipher, where the alphabets are written diagonally and read off horizontally.  ‘JAVA PROGRAMMING’ is written diagonally,           

               J      P       R       I

                A      R       A      N

                   V       O       M      G

                      A        G       M      X

 This can be written horizontally in cipher text as:

JPRI ARAN VOMG AGMX

We have seen simple illustrations of the substitution cipher and the transposition cipher.

 Advantages and Disadvantages of the symmetric algorithm:

The advantages of symmetric algorithms include speed and with a larger key size – harder to crack algorithm. However, there are traditional problems associated with symmetric ciphers are:

  1. Key distribution problem : The “key” is the crucial part of the symmetric algorithm, but distributing the key through secure channels is a challenge. The key cannot be emailed or couriered as each of them is susceptible to snooping.
  2. Symmetric ciphers only ensure confidentiality but not authentication and non-repudiation.
    Confidentiality or ensuring that the message is seen only by the required person is possible by symmetric ciphers. Non-repudiation (or a sender retracting that they not sent the message) is not guaranteed by symmetric ciphers.

We have seen the exciting concept of cryptography and have discussed basic cryptographic algorithms.  We will discuss another technical topic in the next post.

About Pavan Gumaste

Pavan Rao is a programmer / Developer by Profession and Cloud Computing Professional by choice with in-depth knowledge in AWS, Azure, Google Cloud Platform. He helps the organisation figure out what to build, ensure successful delivery, and incorporate user learning to improve the strategy and product further.

1 thought on “Cryptography”

Leave a Comment

Your email address will not be published. Required fields are marked *


Scroll to Top