Cryptography Lecture 1 and 2 - IAA-20-04-2020
Cryptography Lecture 1 and 2 - IAA-20-04-2020
Lecture 1 & 2
Koloseni, Daniel (MSc Info. Security & Biometrics, PhD)
Outline
• Basic terms
• Cryptographic algorithms
• Concepts of using Cryptography
• Properties of Algorithms
• Modern Cryptography
Basic terms
• Cryptography :The art and science of crafting ciphers (Cipher
means secret).
• Cryptanalysis: The art and science of breaking ciphers.
• Cryptology: Both of them (Cryptography and Cryptanalysis)
• Cryptosystem :Also called a cipher system. A system that
provides a method for protecting information by encrypting it in
manner that it can only be accessed and used by authorised
users or system (s).
• The basic model of a cryptosystem will be illustrated later.
Goals of Cryptography
• Steganography
“covered writing”
hides the existence of a message
• Cryptography
“hidden writing”
hide the meaning of a message
Cryptosystem
Cipher
Plain text Encryption Decryption Plain text
text
Note: Encryption means changing plain text into cipher text and decryption is changing
cipher text back to plain text
Cryptographic algorithms
• The history of cryptography dates back to ancient Assyrians and
Egyptians.
• Ciphering of the messages were done manually. The use of machines
in cryptography started in twentieth century.
• It is important due to increased concerns over security of sensitive
data and information transacted over the internet.
• A practical way to solve the problem is to deploy cryptography in the
form of cryptographic algorithms.
Cryptographic algorithms
• Algorithm is the step by step procedure for solving a particular
problem.
• In relation to encryption, algorithms, defines how the encryption will
be applied, how the data will be held by the cryptosystem is
encrypted and how data is decrypted by the receiving system(s).
• Try this ..
Decrypt this message “ UBZBSJOJNFJTIBGJLB”. Each letter can be decrypted
by replacing it with a next letter in the alphabet.
• They are weak and therefore very easy to break.
Substitution ciphers
Additional example: Caesar Cipher
• Originally used by Julius Caesar during war.
• Changed the order of the letters of the alphabet to generate ciphers
• Substitute each fourth letter with others. For example “A "was
substituted by “D”.
Encryption steps
• Create a cipher text alphabet (see a shift of 3 example)
Substitution ciphers
• A shift of 3
Plain A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
A simple exercise :
Create a shift of 7 Cipher
Substitution ciphers
Encryption steps
A simple exercise 3
Use the table to encrypt the following messages
A simple exercise :
Why?
• Its easy to integrate with packet transmission.
• Have good diffusion properties.
• Larger blocks contribute to increased cryptographic strength
• However, some specialised areas use stream ciphers
• Such as some communications applications
• Situations where resources are limited
Take home: Read and write short notes on stream and block ciphers
Modern Cryptography
• Modern cryptosystems use computationally complex algorithms to
protect data and information
• Types of Cryptographic algorithms : Hashing, Symmetric and
Asymmetric.
• The main difference between modern and old cryptosystems is on the
use of cryptographic key.
• Old systems relied on secrecy of the algorithms while modern systems
rely on secrecy of the cryptographic key.
Symmetric Key Algorithms
• Is based on shared secret, where both parties know the same secret
(something I know).
• A “shared secret” encryption key that is distributed to all participating
parties in the communications.
• The “shared secret” used by all parties for encrypting and decrypting ,
so the sender and the receiver both possess a copy of the shared key.
• It is primarily suitable for bulk encryption and only provides for the
security service of confidentiality.
• See next slide for the illustration.
Cryptography Definitions
Cipher Cipher
Plain text Encryption Decryption Plain text
text text
• One-Time Pad
• Stream Ciphers
• Block Ciphers
One-Time Pad
• A one-time pad is a system in which a private key generated
randomly is used only once to encrypt a message that is then
decrypted by the receiver using a matching one-time pad and
key.
Example1
Message: HELLO ALICE
Key: SGFKPQYEIJ
Cipher text: ALRWERKNLO
One-Time Pad
Example2
• Encryption:
• 1001001 1000110 Plain text
• 1010110 0110001 Key
• 0011111 1110111 Cipher text
• Decryption:
• 0011111 1110111 Cipher text
• 1010110 0110001 Key
• 1001001 1000110 Plain text
Stream Ciphers
• A stream cipher is an encryption algorithm that encrypts 1 bit or
byte of plaintext at a time.
• A stream cipher encrypts plaintext streams continuously and
therefore needs to maintain an internal state in order to avoid
obvious duplication of encryptions.
• For a stream cipher implementation to remain secure, its
pseudorandom generator should be unpredictable and the key
should never be reused.
Block Ciphers
• A block cipher is an encryption algorithm that encrypts a fixed size of n-bits
of data - known as a block - at one time.
• The usual sizes of each block are 64 bits, 128 bits, and 256 bits. So for
example, a 64-bit block cipher will take in 64 bits of plaintext and encrypt it
into 64 bits of cipher text.
• In cases where bits of plaintext is shorter than the block size, padding
schemes are called into play. Majority of the symmetric ciphers used today
are actually block ciphers.
• DES, Triple DES, AES, IDEA, and Blowfish are some of the commonly
used encryption algorithms that fall under this group.
Block Ciphers Encryption Modes
• Original ECB
Block Cipher Encryption Modes: CBC
• Cipher Block Chaining mode (CBC)
– each block XOR'd with previous block
– start with a random Initialization Vector (IV)
– helps overcome replay attack.
• Suppose the plain text is B1, B2, ..., Bn.
IV = random number (sent in the clear)
C1 = encrypt(B1 xor IV),
C2 = encrypt(B2 xor C1).
….. Ci = encrypt(Bi xor Ci-1).
CBC
Block Cipher Modes
• The first simply encrypts the plaintext three times, using three different
keys: K1, K2, and K3.
Triple DES (3DES
• It is known as DES-EEE3 mode (the Es indicate that there are
three encryption operations, whereas the numeral 3 indicates
that three different keys are used).
• Symmetric key cryptography: Bob and Alice share the same (symmetric)
key: K (For example, encryption algorithm is DES).
• Question: How do Bob and Alice agree on key value?
• What if Bob and Alice have never “met” before?
• Even Better Question: How is the agreed upon key distributed to both Bob
and Alice in a secure fashion?
Symmetric Key Cryptography: Key Issues
• Secret key management- should be a secure method of exchanging
the secret key without anybody else eavesdropping.
• Difficult to implement nonrepudiation, because any communicating
party can encrypt and decrypt messages with the shared secret key,
there is no way to tell where a given message originated.
• Not easily scalable
• Difficult for large groups to communicate. Why?
• Secure private communication between individuals in the group
could be achieved only if each possible combination of users
shared a private key.
• Keys regeneration - Each time a participant leaves the group, all
keys that involved that participant must be discarded.
Scalability issue explained
Read about it
Hybrid Secret-Public Key Cryptography
Since only these two parties know the session key, the messages are secure.
Since secret key cryptography is used, this can be done relatively efficiently.