MISS-1103 System and Network Security - File Useful For File-02 - Overview of Cryptography - KMA
MISS-1103 System and Network Security - File Useful For File-02 - Overview of Cryptography - KMA
MISS-1103:
Professor
Institute of Information Technology (IIT)
Jahangirnagar University, Dhaka-1342 IIT, JU
File: Required for File 02
Overview of Cryptography
Slide 2 IIT, JU
What is Cryptography?
Ensuring the security of Electronic data is a vital issue for E-
commerce. The transmission of purchase information, credit card
numbers, and other transaction information must be secure to give
consumers and merchants the confidence they need to do business
over the Internet.
Encrypt Decrypt
Ciphertext Decrypted text/
Plaintext/Cleartext Plaintext
Happy Valentine’s Day Gzoox Uzkdmshmd’r Czx Happy Valentine’s Day
Slide 4 IIT, JU
Parts of a Cryptographic System:
Generally, all cryptographic processes have four basic parts:
1. Plaintext
2. Ciphertext
3. Cryptographic Algorithm
Slide 5 IIT, JU
Basic Terminology Related to Cryptography
Plaintext/ Cleartext:
It is the original message that is being protected.
Encrypt:
To transform a plaintext into ciphertext.
Decrypt:
To transform a ciphertext into plaintext.
Slide 6 IIT, JU
Basic Terminology Related to Cryptography
Cryptanalysis:
It is the science of studying attacks against cryptographic
schemes. Successful attacks may, for example, recover the
plaintext (or parts of the plaintext) from ciphertext, substitute the
parts of the original message, or forge digital signatures.
Key:
A key is a set of mathematical value, formula or process that the
cipher, as an algorithm, operates on. It determines how a
plaintext message is encrypted or decrypted. The key is the only
way to decipher the scrambled information.
A key is used to encrypt the message. Another or the same key is
used to decrypt the message. As the size of key, used to encrypt
a message, increases, so does the difficulty in deciphering the
message.
Slide 7 IIT, JU
Kinds of Cryptography
There are two main types of encryption:
1. Single key or secret key or symmetric-key cryptography
2. Public key or asymmetric-key cryptography
Slide 8 IIT, JU
Idea Behind Symmetric-key Cryptography:
This is an encryption system in which both sender and receiver
possess the same key for communication on the other direction.
Both parties can encrypt and decrypt messages with this same
key. The sender and receiver must have a shared key set up in
Slide 9 IIT, JU
Idea Behind Symmetric-key Cryptography:
Postal Analogy of Symmetric-key Cryptography:
In the symmetric-key cryptography, the same key is used to both
encrypt and decrypt message.
An analogy that can be used to understand the advantages of an
The problem with this method is how to give Bob a copy of the key
that Alice used.
Slide 10 IIT, JU
Idea Behind Symmetric-key Cryptography:
To create the ciphertext from the plaintext, Alice uses an
encryption algorithm and a shared secret key.
To create the plaintext from ciphertext, Bob uses a decryption
algorithm and the same secret key.
Merits:
Symmetric key algorithms are computationally less intensive than
asymmetric key algorithms. In practice, this means that a quality
asymmetric key algorithm is much slower than a quality symmetric
key algorithm.
Slide 12 IIT, JU
Idea Behind Asymmetric-key Cryptography:
It is an encryption system in which two mathematically related keys are used for encoding
and decoding the message. Of the two keys, one is called public key that any one can
know. Another is called private key that only the owner knows.
Public key can encrypt information, whereas, the private key can decrypt it. The private
key is assigned to one designated owner, but the public key can be announced to the
world. It can be published in a newspaper, on a server, on a website, or via a service
provider so that anyone can encrypt with it.
Slide 14
Figure: Locking and unlocking in asymmetric-key cryptosystemIIT, JU
Idea Behind Asymmetric-key Cryptography:
Asymmetric-key cryptography uses two separate keys: a private key and a public key.
Both sending and receiving entity have their own key pairs, where one key (usually public key) is
used to encrypt message and another key (usually private key) is used to decrypt message. In other
words, a message encrypted with a public key can be decrypted only with the corresponding private
key.
Alice uses Bob’s public key to send encrypted message to Bob.
Bob uses his private key to decrypt message sent by Alice.
Bob needs only one private key to receive all correspondence from anyone in the community, but
Slide 18 IIT, JU
Modes of Usages of Asymmetric-key Cryptography:
Providing Authenticity of the Message Originator:
In this way of private-public key-pairs, data encrypted with the
private key can only be decrypted with the public key.
Use asymmetric-key encryption for authentication.
Here, data is encrypted by the sender using his/her
Slide 19 IIT, JU
Symmetric-key Vs. Asymmetric-key Cryptography:
Key-point Symmetric-key Asymmetric-key
Invention More than 2000 years (at In the mid 1970’s
least in primitive form)
Key length This approach uses shorter This approach uses longer
keys keys
Slide 20 IIT, JU
Symmetric-key Vs. Asymmetric-key Cryptography:
Key-point Symmetric-key Asymmetric-key
Is distribution of key Not so easy, since both Easy, because only the public
easy? the sender and receiver key is to be distributed which
posses the same key. is open to all.
Slide 21 IIT, JU
Symmetric-key Vs. Asymmetric-key Cryptography:
Key-point Symmetric-key Asymmetric-key
Does it support No, because both parties have Yes
non-repudiation the same key.
requirement?
Nature of In symmetric-key cryptography, But in asymmetric-key
plaintext and the plaintext and ciphertext are cryptography, the plaintext
Slide 23 IIT, JU
Common Cryptosystems:
Some widely used cryptosystems are described here briefly.
RSA Algorithm:
It is the most commonly used public-key algorithm, although it is vulnerable to
attack.
It is named so after its inventors, Ron Rivest, Adi Shamir, and Len Adlemman of
Slide 24 IIT, JU
Common Cryptosystems:
3DES:
Stronger version of DES called Tripple DES, uses three 56-bit key to encrypt
each block.
The first key encrypts the data block, the second key decrypts the data block
and the third key encrypts the same data block again.
It offers strong encryption using a 128-bit key to encrypt 64-bit blocks. This
system is widely used in older version of PGP (Pretty Good Privacy) system.
Slide 25 IIT, JU
Need for Both Cryptography:
There is a very important fact that is sometimes misunderstood:
The advent of asymmetric-key cryptography does not eliminate the need for
symmetric-key cryptography.
Slide 26 IIT, JU
Merits and Demerits of Encryption:
The advantages of Cryptography are:
It hides the message and your privacy is safe.
No one would be able to know what it says unless there's a key to the code.
You can write what ever you want and how ever you want (any theme any
symbol for the code) to keep your code a secret.
Cryptography allows people to carry over the confidence found in the physical
world to the electronic world, thus allowing people to do business electronically
without worries of deceit and deception. Every day hundreds of thousands of
people interact electronically, whether it is through e-mail, e-commerce
Slide 30 IIT, JU
Four security needs provided by Encryptions:
Properly implemented encryption proves identity.
When logging a username and password are provided.
o Both are unique keys.
If this personal information is kept private and is encrypted, then in a perfect
world:
3. Non-repudiation:
The sender should not be able to later deny that he/she sent a message. It is
a procedure that prevents sender and vendor in a transaction or
communication activity from later falsely denying that the transaction
occurred. Non-repudiation is like sending a certified letter with a return
receipt via postal system. Like a receipt accompanying the registered letter, a
digital signature accompanies the transfer of data, so, the originator cannot
deny having sent the message.
Slide 31 IIT, JU
Four security needs provided by Encryptions:
4. Privacy:
Privacy is when the data transmission is kept private. It shields
communications from unauthorized viewing or access. For example, Rassel
might not want his wife or any other person to know what he is transacting,
nor does the vendor want to reveal the special deal he/she has made for that
particular customer.
Slide 32 IIT, JU
Key Distribution/ Exchange of Symmetric Key:
In symmetric-key cryptography, Alice and Bob use the same key for
communication on the other direction. This key must be protected from
access by others.
However, Alice may need to communicate with another person, say
David. Then she needs another secret key. The more keys Alice uses, the
more complexity may arise to handle those keys.
Furthermore, frequently key exchanges are usually desirable to limit the
How many keys do you need for communicating with a group of m persons?
Number of keys = (m(m-1))/2
Slide 33 IIT, JU
Cryptography Vs. Cryptanalysis:
Slide 34 IIT, JU
Traditional Symmetric- Key Ciphers
Traditional symmetric-key ciphers can be classified into two broad categories:
1. Substitution Ciphers
A substitution cipher replaces one symbol with another. For example, we
can replace letter A with letter D, and letter T with letter Z. If the
symbols are digits, we can replace 3 with 7, 2 with 6.
2. Transposition Ciphers
A transposition cipher does not substitute one symbol for another,
instead it changes the location of the symbols.
A symbol in the first position of the plaintext may appear in the ninth
position of the ciphertext. A symbol in the eighth position of the
plaintext may appear in the first position of the ciphertext. For example,
the plaintext characters “hello” may be encrypted as “elhol”.
Slide 36 IIT, JU
Stream Ciphers
Stream cipher encrypts a single character or bit of plaintext at a time. It
also decrypts a single character or bit of ciphertext at a time.
Both the encryption and decryption are performed using the same key.
Example:
To decrypt this ciphertext, all we need to do is again XOR the ciphertext with the
keystream:
Ciphertext : 00110001011110100
Keystream : 10101010101010101
Plaintext (XOR) : 10011011110100001
Slide 37 IIT, JU
Block Ciphers
A symmetric-key modern block cipher encrypts an
n-bit block of plaintext or decrypts an n-bit block of ciphertext
together using the same secret key.
The common values of n are 64, 128, 256, or 512 bits.
If the message has the fewer than n bits, padding must be added to
Example:
Plaintext : The only thing we have to fear is fear itself
Plaintext blocks : Theonlyt hingweha vetofear isfearit selfXend (break the plaintext into 8-character block)
Ciphertext blocks : tylnoehT ahewgnih raefotev tiraefsi dneXfles (just reverse each plaintext block)
Ciphertext : tylnoehTahewgnihraefotevtiraefsidneXfles
Slide 38 IIT, JU