You are on page 1of 12

ENCRYTION ALGORITHMS:

There are two main types of cryptography in use today - symmetric or secret key
cryptography and asymmetric or public key cryptography. Symmetric key
cryptography is the oldest type whereas asymmetric cryptography is only being used
publicly since the late 1970s.
Secret key cryptography involves the use of only one key which is used for both
encryption and decryption (hence the use of the term symmetric).

To accomplish encryption, most secret key algorithms use two main techniques known
as substitution and permutation. Substitution is simply a mapping of one value to
another whereas permutation is a reordering of the bit positions for each of the inputs.
These techniques are used a number of times in iterations called rounds. Generally,
the more rounds there are, the more secure the algorithm. A non-linearity is also
introduced into the encryption so that decryption will be computationally infeasible
without the secret key. This is achieved with the use of S-boxes which are basically
non-linear substitution tables where either the output is smaller than the input or vice
versa.
One of the main problems with secret key cryptography is key distribution. For this
form of cryptography to work, both parties must have a copy of the secret key. This
would have to be communicated over some secure channel which, unfortunately, is not
that easy to achieve. Public key cryptography provides a solution to this.
DES:
The main standard for encrypting data was a symmetric algorithm known as the Data
Encryption Standard (DES). However, this has now been replaced by a new standard
known as the Advanced Encryption Standard (AES).
DES is based on a cipher(Lucifer) known as the Feistel block cipher developed
earlier by IBM for Lloyds of London for cash transfer. This was a block cipher
developed by the IBM cryptography researcher Horst Feistel in the early 70s. It
consists of a number of rounds where each round contains bit-shuffling, non-linear
substitutions (S-boxes) and exclusive OR operations. Most symmetric encryption
schemes today are based on this structure (known as a feistel network).
The data encryption standard (DES) is widely used for symmetric encryption of large
amounts of data. It is standardized, and thus very attractive for symmetric encryption
in uncoordinated environments, often using a random session key communicated
confidentially by a digital envelope.

DES is a 64 bit block cipher which means that it encrypts data 64 bits at a time. This is
contrasted to a stream cipher in which only one bit at a time (or sometimes small
groups of bits such as a byte) is encrypted.
The DES algorithm uses the two basic techniques of encryption:
Confusion: The relationship between plaintext and ciphertext is obscuredin DES,
this is achieved by a key-dependent substitution in the round function.
Diffusion: The plaintext is diffused throughout the ciphertextmaking every part of
the ciphertext dependent on every part of the plaintextby the swapping between
stages.
Many algorithmic-based block encryption algorithms depend on some combination of
confusion and diffusion.

Fig : The sixteen rounds of the DES encryption algorithm.


The 64-bit plaintext is split in two 32-bit blocks, and passed through sixteen stages of a
round function. One half the ciphertext is transformed by a round function, which also
depends on a subset of the key, and is then combined with the other half using a bitby-bit addition. The results of each stage are swapped before being applied to the
following round function stagesixteen in all.
BLOCK CIPHERS:

BLOCK CIPHER FEATURES:

DES DECRYTION: Decryption uses the same algorithm as encryption, except that the
subkeys K1, K2,...K16 are applied in reversed order.

AES:
Advanced Encryption Standard (AES) is the current standard for secret key
encryption. AES was created by two Belgian cryptographers, Vincent Rijmen and Joan
Daemen, replacing the old Data Encryption Standard (DES). The Federal Information
Processing Standard 197 used a standardized version of the algorithm called Rijndael
for the Advanced Encryption Standard. The algorithm uses a combination of
Exclusive-OR operations (XOR), octet substitution with an S-box, row and column
rotations, and a MixColumn. It was successful because it was easy to implement and
could run in a reasonable amount of time on a regular computer.
Cryptography is the science of information and communication security.
Cryptography is the science of secret codes, enabling the confidentiality of
communication through an insecure channel. It protects against unauthorized parties
by preventing unauthorized alteration of use. It uses a cryptographic system to
transform a plaintext into a cipher text, using most of the time a key.
There exists certain cipher that doesn't need a key at all. An example is a simple
Caesar-cipher that obscures text by replacing each letter with the letter thirteen places
down in the alphabet. Since our alphabet has 26 characters, it is enough to encrypt the
cipher text again to retrieve the original message.
AES is an iterated block cipher with a fixed block size of 128 and a variable key
length. The different transformations operate on the intermediate results, called state.
The state is a rectangular array of bytes and since the block size is 128 bits, which is
16 bytes, the rectangular array is of dimensions 4x4. The cipher key is similarly
pictured as a rectangular array with four rows. The number of columns of the cipher
key, denoted Nk, is equal to the key length divided by 32.

It is very important to know that the cipher input bytes are mapped onto the state bytes
in the order and the bytes of the cipher key are mapped onto the array in the order. At
the end of the cipher operation, the cipher output is extracted from the state by taking
the state bytes in the same order. AES uses a variable number of rounds, which are
fixed: A key of size 128 has 10 rounds. A key of size 192 has 12 rounds. A key of size
256 has 14 rounds.
During each round, the following operations are applied on the state:
1. Sub Bytes: Every byte in the state is replaced by another one, using the Rijndael SBox
2. Shift Row: Every row in the 4x4 array is shifted a certain a
mount to the left
3. Mix Column: a linear transformation on the columns of the state
4. AddRoundKey: each byte of the state is combined with a round key, which is a
Different key for each round and derived from the Rijndael key schedule
Salient Features:
The cipher key is expanded into a larger key, which is later used for the actual
operations
The round Key is added to the state before starting the with loop
The Final Round () is the same as Round (), apart from missing the Mix Columns ()
operation.
During each round, another part of the Expanded Key is used for the operations
The Expanded Key shall always be derived from the Cipher Key and never be
specified directly.
AES operations: SubBytes, ShiftRow, MixColumn and AddRoundKey
The AddRoundKey operation: In this operation, a Round Key is applied to the state
by a simple bitwise XOR. The Round Key is derived from the Cipher Key by the
means of the key schedule. The Round Key length is equal to the block key length
(=16 bytes).

The ShiftRow operation: In this operation, each row of the state is cyclically shifted
to the left, depending on the row index.
The 1st row is shifted 0 positions to the left.
The 2nd row is shifted 1 position to the left.
The 3rd row is shifted 2 positions to the left.
The 4th row is shifted 3 positions to the left.

The inverse of Shift Row is the same cyclically shift but to the right. It will be needed
later for decoding.
The SubBytes operation : The SubBytes operation is a non-linear byte substitution,
operating on each byte of the state independently. The substitution table (S-Box) is
invertible and is constructed by the composition of two transformations:
1. Take the multiplicative inverse in Rijndael's finite field
2. Apply an affine transformation which is documented in the Rijndael documentation.
Since the S-Box is independent of any input, pre-calculated forms are used. Each byte
of the state is then substituted by the value in the S-Box whose index corresponds to
the value in the state:
a(i,j) = SBox[a(i,j)]
The inverse of SubBytes is the same operation, using the inversed S-Box, which is also
precalculated.
The MixColumn operation: This section involves advance mathematical calculations
in the Rijndael's finite field. It corresponds to the matrix multiplication with:
2311
1231
1123
3112
And that the addition and multiplication operations are different from the normal ones.

The first nine rounds of the decryption algorithm consist of the following:
1.Inverse Shift rows
2.Inverse Substitute bytes
3.Inverse Add Round Key
4.Inverse Mix Columns
RSA:
Public-key cryptography is also known as asymmetric-key cryptography. One of
the earliest and still a popular asymmetric encryption algorithm is RSA. Encryption
and decryption are carried out using two different keys. The two keys in such a key
pair are referred to as the public key and the private key.
#Public key/ two key/ asymmetric cryptography involves the use of two keys:
~A public key, which may be known by anybody, and can be used to encrypt
messages, and verify signatures.

~A related private key, known only to the recipient, used to decrypt messages, and
sign(create) signatures.
#is asymmetric because those who encrypt messages or verify signatures cannot
decrypt messages or create signatures.
While DES treats the data block in its more basic forma collection of bits
RSA presumes that the plaintext block is a representation of an integer using base-two
arithmetic. Thus, the algorithm assumes the plaintext and the ciphertext are integers
represented by the data in the plaintext and ciphertext blocks. Further, the algorithm
presumes these two integers fall in the range, 0<=P<n , 0<=C<n, where the so-called
modulus is presumed to be the product of two prime numbers.
Public-key encryption can be used to provide both confidentiality and
authentication at the same time. Confidentiality means that we want to protect a
message from eavesdroppers and authentication means that the recipient needs a
guarantee as to the identity of the sender.

Fig : The RSA algorithm works with integers represented as points on a circle.
The RSA algorithm named after Ron Rivest, Adi Shamir, and Leonard
Adleman is based on a property of positive integers. The RSA (Rivest-ShamirAdleman algorithm) is the most important public-key cryptosystem. It is the
foundation of public-key substitution ciphers. The RSA works because:

We also need these lemmas.

Lemma 1. If n = p1p2 ...ph is a product of distinct primes, then i) (n) = (p11)(p21)...


(ph1), and ii) pi1divides (n) for all i.
Lemma 2: If n = p1p2 ...ph is a product of distinct primes, then k 1 (mod (n)) ak a
(mod n) for any a.

RSA Key Generation Steps:

Public key applications can classify uses into three categories:


1) Encryption/decryption(provide secrecy)
2) Digital signatures(provide authentication)
3) Key exchange(of session keys)
RSA ALGORITHM:

You might also like