Posts

Symmetric key cryptography

Image
Symmetric key cryptography started thousand years ago, when people needed to exchange secrets (for example in a war ). We still mainly uses symmetric key cryptography in our network security. However, today ciphers are much more complex. Let us first discuss traditional algorithms, which were character oriented. Then we discuss modern one which are nit oriented. Traditional ciphers : We briefly introduce some traditional ciphers, which are character oriented. Although these are now obsolete, the goal is to show how modern cipher evolved from them. We can divide traditional symmetric key ciphers in to two broad categories namely -- substitution ciphers and traditional ciphers, as shown in the following figure. Substitution ciphers : A substitution cipher substitute one symbol with another. If the symbol in the plain text are alphabetic character, we replace one character by another. For example, we can replace character 'a' with character 'd' ,  and characte...

Cryptography

Image
"Cryptography, a word with Greek origin means Secret  writing . However, we use the term to refer to the science and art of transforming messages to make them secure and immiane to attacks."    Following figure shows the components involved in cryptography. Plain Text and Cipher Text The original message, before being transformed is called plain text. After the message is transformed, it is called cipher text. An encryption algorithm transform the plain text into cipher text; a description algorithm transformed the cipher text into plain text. The sender uses an encryption algorithm and the receiver uses a decryption algorithm. Ciphers We refer to encryption and decryption algorithm as ciphers. The term cipher is also used to refer to different categories of algorithm in cryptography. This is not o say that every sender-receiver pair needs their very own unique cipher for a secure communication on the contrary, one cipher can serve millions ...

The extended euclidean algorithm

Image
The extended euclidean algorithm Given two integers a and b, we often need to find other two integers s and t such that  s * a + t * b = gcd ( a, b ) The extended euclidean algorithm can calculate the gcd ( a, b ) and at the same time calculate the values of s and t. The algorithm uses three sets of variables r's, s's and t's. In each state r1, r2 and r have same value in the euclidean algorithm. The variables r1, r2 are initializes t the value of a and b respectively. The variables s1, s2 are initialized to 1 and 0 respectively. The variables t1 and t2 are initialized t 0 and 1 respectively.  r1 = a ; r2 = b ; ( Initialization) s1 ← 1 ; s2 ← 0 ; t1 ← 0 ; t2 ← 1 ;  while ( r2 > 0)  {    q = r1 / r2;    r = r1 - q * r2 ; (updating r )    r1 ← r2;  r2 ← r ;    s ← s1 - q * s2 ;    s1 ← s2 ; s2 ← s ; (updating S's)    t ← ...

Euclid's Algorithm to find greatest common divisior

Image
Greatest common divisor One integer often needed in cryptography is the greatest common divisor of two positive integers. Two positive integer may have many common divisor but only one greatest common divisor. For example, the common divisor of 12 and 140 are 1, 2 and 4. However, 4 is the greatest common divisor.       The greatest common divisor of two integers is largest integer which can divide both given integers. The following block diagram illustrate the basic of the greatest common divisor of 12 and 140. " Euclidean Algorithm " Finding the greatest common divisor ( GCD ) of two positive integers by listing all common divisor is not practical, when the two number integers are large. Fortunately, more than 2000 years ago a mathematician named Euclid develop an algorithm that can find the greatest common divisor of two positive integers. The Euclidean algorithm is based on the following two facts: 1. gcd ( a, 0 ) = a 2. gcd ( a, b ...

Integer Arithmetic

Image
In integer arithmetic, we use a set and few operations. We are familiar with this set and corresponding, but they are reviewed here to create a background for modular arithmetic. ( i ) Set of Integers : The set of integers, denoted by 'Z', contains all integral number ( with no fractions ) from negative infinity to positive infinity. Which is shown as follows Z = { -∞, ........, -2, -1, 0, 1, 2, ............., +∞ }. ( ii ) Binary operations : In cryptography, we are interested in three binary operations applied to the set of integers. The binary operation takes two integers and create one output. Three common binary operations defined for  integers are addition, subtraction and multiplication. Each of these operations takes two input ( a, b ) and creates one output ( c ) as shown in the following figure. The following shows the results of the three binary operations on two integers because each input can be either positive or negative, we can ...

Properties of group

There are two properties of group as follows (a) Identity element in a group is unique. Proof :             Let e be the identity element of a group ( G, O ), Then we have to show that 'e ' is unique. If possible let e' be an other identity element of the same group ( G, O ). ∵ e be the identity. ∴ a O e = e O a = a ∀ a ∊ G If a = e' then, e' O e = e O e' = e'  ∀ e' ∊ G     ➖ ➖ ➖ ➖ ➖ (i) Again, e' is the identity So, a O e' = e' O a = a ∀ a ∊ G e O e' = e' O e = e ∀ e ∊ G   ➖➖➖➖➖ (ii) from (i) and (ii) we get,  e = e' Hence, there is one and only one identity element is present in G. (b) Formation of Ring (Ring) Ring :   A non-empty set 'R' with two binary operation '+'  ( called ordinary addition ) and '*' ( called ordinary multiplication ) is said to be a ring ( R, +, * ) if ( R, + ) is an abelian group , ( R, * ) is a semi-group  and '*' is distribut...

Abelian Group or Commutative Group

"A group (G,O) is said to be an abelian group or a commutative group if (a O b) = (b O a)    a, b ᗴ G . "  OR "A non-empty set 'G' together with a binary operation 'O' is said to be a group, if the following laws holds for all the operations 'O'." Group holds the following given five laws :    (a)  Clouser Law   :  'G' is cloused under the binary operation 'O' that is ( a O b ) = ( b O a )  ∀ a, b ᗴ G . (b)  Associative Law :  The associative law for the operation holds that is  a O ( b O c ) = ( a O b ) O c  ∀ a, b, c ᗴ G. (c)  Existence of Identity Element :  The identity element exists in 'G' that is there exists an element e  ᗴ  G such that a  ᗴ   e = e  ᗴ  a = a  ∀ a  ᗴ G. (d)  Existence of Inverse Element :  The inverse element of all the elements of 'G' exists that is for every a  ᗴ G there exists an element b  ᗴ G su...