NSC Unit-3
NSC Unit-3
Substitution technique is one that the letters in the plaintext will be replaced by other letters or by
numbers or symbols.
[Caesar Cipher]
The earliest use of substitution cipher is also the simplest one that is proposed by Julius
Caesar, called Caesar Cipher. The Caesar Cipher works with replacing each letter with the letter
standing three places further down of the alphabet order.
For example:
plaintext: abcdefghwxyz
ciphertext: ef gh ijk l zabc
So if the plaintext is “meet me after the party”. The ciphertext would be “phhw ph diwhu
wkh sduwb”.
plaintext: meet me after the party
ciphertext: phhw ph diwhu wkh sduwb
If we assign each letter a number from 0 to 25(from A to Z). Take the Ciphertext as C,
Encryption as E, and plaintext as P. Then we can describe the Caesar Cipher as below:
C=E(p)=(p+3)mod(26) (1)
A shift could be any amount, so the general Caesar algorithm is
C=E(p)=(p+k)mod(26) (2)
where k takes on a value in the range from 1 to 25. And the decryption algorithm is simply
p =D(C)=(C-k)mod(26) (3)
If it is known that a given ciphertext is a Caesar cipher, then a brute-force cryptanalysis will be
easily performed. Just try all the 25 for the possible value of k.
In this example, there are three reasons for us to use the brute-force cryptanalysis. First is that the
encryption and the decryption algorithms are known. Second is that there are only 25 keys to try.
Third is that the language of the plaintext is known and easily recognizable.
Transposition Techniques
Transposition technique is achieved by performing some kind of permutation on the
plaintext letters. It is very simple to realize this kind of cipher. We can do it by the example. If
the plaintext is “meet me after the party”, we can rearrange it by this way:
mematrhpry
et e f eteat
So we get the plaintext and the ciphertext like this:
plaintext: meet me after the party
ciphertext: mematrhpryetefeteat
[Columnar transposition]
Another simple transposition cipher is called Columnar transposition. If the plaintext is
“data encryption”, we will compose the sentence into a 3*5 matrix. For example:
key: 41235
plaintext : data
encry
pt I on
ciphertext: anttciarodep yn
Of course, the transposition cipher can be made more secure by performing more than
one stage of transposition. For example, doing the Columnar transposition 2 or 3 times and it will
efficiently to increase the security of this cipher.
The user takes the first block of plaintext and encrypts it with the key to produce the first
block of ciphertext.
He then takes the second block of plaintext and follows the same process with same key
and so on so forth.
The operation of CBC mode is depicted in the following illustration. The steps are as follows −
The operation of CFB mode is depicted in the following illustration. For example, in the present
system, a message block has a size ‘s’ bits where 1 < s < n. The CFB mode requires an
initialization vector (IV) as the initial random n-bit input block. The IV need not be secret. Steps
of operation are −
It involves feeding the successive output blocks from the underlying block cipher back to it.
These feedback blocks provide string of bits to feed the encryption algorithm which act as the
key-stream generator as in case of CFB mode.
The key stream generated is XOR-ed with the plaintext blocks. The OFB mode requires an IV as
the initial random n-bit input block. The IV need not be secret.
It can be considered as a counter-based version of CFB mode without the feedback. In this mode,
both the sender and receiver need to access to a reliable counter, which computes a new shared
value each time a ciphertext block is exchanged. This shared counter is not necessarily a secret
value, but challenge is that both sides must keep the counter synchronized.
Operation
Both encryption and decryption in CTR mode are depicted in the following illustration. Steps in
operation are −
Load the initial counter value in the top register is the same for both the sender and the
receiver. It plays the same role as the IV in CFB (and CBC) mode.
Encrypt the contents of the counter with the key and place the result in the bottom
register.
Take the first plaintext block P1 and XOR this to the contents of the bottom register. The
result of this is C1. Send C1 to the receiver and update the counter. The counter update
replaces the ciphertext feedback in CFB mode.
Continue in this manner until the last plaintext block has been encrypted.
The decryption is the reverse process. The ciphertext block is XORed with the output of
encrypted contents of counter value. After decryption of each ciphertext block counter is
updated as in case of encryption.
Hybrid Encryption
Hybrid encryption is a mode of encryption that merges two or more encryption systems.
It incorporates a combination of asymmetric and symmetric encryption to benefit from the
strengths of each form of encryption. These strengths are respectively defined as speed and
security.
Hybrid encryption is considered a highly secure type of encryption as long as the public
and private keys are fully secure. A hybrid encryption scheme is one that blends the convenience
of an asymmetric encryption scheme with the effectiveness of a symmetric encryption scheme.
Hybrid encryption is achieved through data transfer using unique session keys along with
symmetrical encryption. Public key encryption is implemented for random symmetric key
encryption. The recipient then uses the public key encryption method to decrypt the symmetric
key. Once the symmetric key is recovered, it is then used to decrypt the message.