0% found this document useful (0 votes)
17 views

Unit 2.1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Unit 2.1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

UNIT 2 – INTRODUCTION

TO CRYPTOGRAPHY
J. KASIROORI
DEPARTMENT OF ANALYTICS AND
INFORMATICS
WHAT IS
CRYPTOGRAPHY
• The study of secure communication techniques that allow on the
sender and intended recipient of a message to view its contents
• Cryptography is the science of using mathematics to encrypt and
decrypt data.
• Cryptography is closed associated with encryption but is not the same
• Main Goal is to ensure security of communication over insecure
medium
TERMINOLOGY
• Plain text or cleartext – the message to be transmitted, usually in
human readable form
• Encryption – The process of disguising a message in a way to hide its
substance
• Ciphertext - scrambled message or the encrypted message
• Key - secret used in transformation
• Key Space – set of all valid, possible, distinct keys of a given
cryptosystem
• Cipher - an algorithm for performing encryption or decryption
TERMINOLOGY
• Cryptanalysis on the other hand is the
science of analyzing and breaking secure
communication
• Cryptology embraces both cryptography
and cryptanalysis
PILLARS OF CRYPTOGRAPHY

• Confidentiality – keep communications private


• Integrity – detect unauthorised alterations to communication
• Authentication – confirm identity of the sender
• Authorisation – establish level of access for trusted parties
• Non-repudiation – prove that communication was received
CRYPTOGRAPHY OVERVIEW

Plain Text Cipher text Plain Text


Encryption Decryption
EXERCISE

Look up and understand then history of Cryptography


CLASSES OF CRYPTOGRAPHY
• According to NIST there are 3 broad classes of
cryptography
• Classes are determined by the number or types of
cryptographic keys used by each
• The classes are:
• Symmetric key algorithms
• Asymmetric key algorithms
• Hash Functions
SYMMETRIC KEY ALGORITHMS
• Also known as Secret Key Cryptography or Conventional
Cryptography
• This is an encryption system in which the sender and receiver
of a message share a single, common key that is used to
encrypt and decrypt the message.
• The key is known by both the sender and the receiver
• The key is usually known by one or more authorized
personnel
SYMMETRIC KEY OVERVIEW
KEY (k)

Plain Text Cipher text Plain Text


Encryption Decryption
USES OF SYMMETRIC KEY
ALGORITHMS
Exercise

• List and explain any 3 uses of


symmetric key algorithms
STRENGTHS AND LIMITATIONS
• Sender and receiver have to know each
other before
• Both must be in possession of the key
• Use of one time pad can make it more
secure
SYMMETRIC KEY ENCRYPTION
ALGORITHMS

• Data Encryption Standard (DES)


• Advanced Encryption Standard (AES)
• Rijndael
• Blowfish
ASYMMETRIC ALGORITHMS

• This is also known as “Public Key” encryption


ASYMMETRIC KEY OVERVIEW

Plain Text Cipher text Plain Text


Encryption Decryption

KEY (k) KEY (k1)


USES OF ASYMMETRIC KEY
ALGORITHMS
• Identity management
• Computing digital signatures
• Web browsers
• Digital certificates
HASH FUNCTIONS
• Hash function often use many cryptographic components
• A hash function takes an arbitrary, but bounded length input and
generates a fixed length output
• The output is referred to as a hash, message digest or digital fingerprint
• A hash function should be collision resistant, that is it should be hard to
find any two different inputs x and y where h(x) = h(y)
• The output of a hash function should not be predictable
• A change in one bit of the original message should result in change to
half of the hash
• A good hash should be non-reversible
HASH FUNCTIONS OVERVIEW

Message Hash
Hash function
HASH FUNCTION ALGORITHMS
• Message Digest 5 (MD5)
• Secure Hash Function (SHA) – The most popular
being SHA-512
• RACE Integrity Primitives Evaluation Message Digest
(RIPEMD)
• Whirlpool
USES OF HASH FUNCTIONS
• Password storage
• Message and data integrity checks
• Digital signatures
IN CLASS EXERCISES

1. Using the Python hashlib:


i. Create an MD5 hash of your name
ii. Create an MD5 hash of your surname
iii. Do the same for the SHA generator
iv. Comment on both output
TYPES OF CIPHERS
• Shift ciphers
• Block ciphers
• Stream ciphers
SHIFT CIPHER
• Shift ciphers work by ‘shifting a letter’ a number of spaces to the right
in the alphabet
• The number of spaces or times a letter is moved is called the “shift”
• Caesar’s cipher is the most popular shift cipher
• Caesar’s cipher uses a shift of 3
• Therefore, in the alphabet A becomes D, B becomes E and so on
BLOCK CIPHERS
• A block cipher encrypts a fixed length of bits
• These fixed length groups are called blocks
• Generally a block cipher avoids encrypting very small or very large
blocks
• Smaller bits are easier to crack and larger blocks make the cipher
inefficient
• DES, Triple DES, AES are all examples of block ciphers
• Block ciphers use symmetric key algorithms for encryption
BLOCK CIPHERS

Cipher text 8 bit 8 bit 8 bit Plain Text


Plain Text 8 bit 8 bit 8 bit
block block block block block block
STREAM CIPHERS
• Stream ciphers encrypt data one binary digit (bit) at
a time
• Stream ciphers are faster than block ciphers
• Stream ciphers can be classified into 3 classes
asynchronous, synchronous and one time pad
IN CLASS EXERCISE

1. Install the caesarcipher module in Python and use that module to:
i. Create cipher text for the string “HCF103 rocks, I love it tops”,
without stating an offset
ii. Do the same as in – using a shift (offset) of 4
iii. Using the Caesar Cipher manually (not the Python implementation)
encrypt a string of your choice.
iv. Using the cracked function of the caesarcipher decrypt the encrypted
string above
Thank you

You might also like