University Institute of Engineering
AIT-CSE
Privacy and Security in IoT - CSD- 433
Unit 2- Cryptographic Fundamentals For IoT
Topic- Hashes and Functions
Lecture – 9(b)
Delivered by
Er. Gaurav Soni (E9610)
Assistant Professor, AIT-CSE
DISCOVER . LEARN . EMPOWER
Privacy and Security in IoT
Course Objectives
CO Number Title
CO1 To identify various privacy and security requirements in Internet of
Things
CO2 To learn cryptographic techniques for a secure IoT system
CO3 To understand various Trust Models used in IoT
2
Privacy and Security in
IoT
Course Outcome
This will be covered in this
lecture
CO Title Level
Number
CO1 After successful completion of this course students will Understand
be able to understand the security requirements in IoT.
CO2 After successful completion of this course students will Understand
be able to understand the authentication credentials and
access control.
CO3 After successful completion of this course students will Implement
be able to implement security algorithms to make a
secure IoT system.
3
Topics outline of the Lecture
• Applications of cryptographic • Hash functions based on
hash functions cipher block chaining
• Message authentication • Secure hash algorithm
• Digital signatures (SHA)
• Other applications • SHA-512 logic
• Requirements and security • SHA-3
• Security requirements for
cryptographic hash functions
• Brute-force attacks
• Cryptanalysis
Purpose: Authentication
Authentication Requirements:
Masquerade – Insertion of message from fraudulent source
Content Modification – Changing content of message
Sequence Modification – Insertion, deletion and reordering sequence
Timing Modification – Replaying valid sessions
Hash Functions
Message m Message digest, y
(long) (Shorter fixed length)
Cryptographic hash
Function, h , Shrinks data, so 2 messages can
have the same digest: m1 != m2, but
h = H(M) H(m1) = h(m2)
• Goal: to provide a unique “fingerprint” of the message.
Must demonstrate 3 properties:
1. Fast to compute y from m.
2. One-way: given y = h(m), can’t find any m’ satisfying h(m’) = y easily.
3. Strongly collision-free: Can’t find any m1 != m2 such that h(m1)=h(m2) easily
Basic Hash Function Diagram
Cryptographic Hash Function
Hash Function Uses
Can be used to construct a
Commonly used to create a Can be used for intrusion pseudorandom function
one-way password file and virus detection (PRF) or a pseudorandom
number generator (PRNG)
When a user enters a Store H(F) for each file on a
password, the hash of that system and secure the hash
password is compared to the values
stored hash value for
verification One can later determine if a A common application for a
file has been modified by hash-based PRF is for the
recomputing H(F) generation of symmetric keys
This approach to password
protection is used by most An intruder would need to
operating systems change F without changing
H(F)
Hash Function Uses
to create a one-way password file
store hash of password not actual password
e.g., Unix, Windows NT, etc.
for intrusion detection and virus detection
keep & check hash of files on system
e.g., Tripwire
One-time Passwords
Password safety in distributed system
server compromise does not compromise P
interception of authentication exchange does not compromise
password either
Alice picks Password PA
Hashes password N times, HN(PA)
Server stores (Alice, N, HN(PA))
Attacker can’t get PA from HN(PA)
Two Simple Hash Functions
• Consider two simple insecure hash functions that operate using the following
general principles:
• The input is viewed as a sequence of n-bit blocks
• The input is processed one block at a time in an iterative fashion to produce an n-bit
hash function
• Bit-by-bit exclusive-OR (XOR) of every block
• Ci = bi1 xor bi2 xor . . . xor bim
• Produces a simple parity for each bit position and is known as a longitudinal
redundancy check
• Reasonably effective for random data as a data integrity check
• Perform a one-bit circular shift on the hash value after each block is processed
• Has the effect of randomizing the input more completely and overcoming any
regularities that appear in the input
Two
Simple
Hash Functions
Requirements and Security
Preimage
Collision
• x is the preimage of h for a
hash value h = H(x) • Occurs if we have x ≠ y and
H(x) = H(y)
• Is a data block whose hash
function, using the function • Because we are using hash
H, is h functions for data integrity,
collisions are clearly
• Because H is a many-to-one undesirable
mapping, for any given hash
value h, there will in general
be multiple preimages
Table 1
Requirements for a Cryptographic Hash Function H
(Table can be found on page 323 in textbook.)
Table 2
Hash Function Resistance Properties Required for Various Data Integrity
Applications
* Resistance required if attacker is able to mount a chosen message attack
Attacks on Hash Functions
Brute-Force Attacks Cryptanalysis
• Does not depend on the • An attack based on weaknesses
specific algorithm, only in a particular cryptographic
depends on bit length algorithm
• In the case of a hash function, • Seek to exploit some property
attack depends only on the bit of the algorithm to perform
length of the hash value some attack other than an
• Method is to pick values at exhaustive search
random and try each one until
a collision occurs
Secure Hash Algorithm (SHA)
• SHA was originally designed by the National Institute of Standards
and Technology (NIST) and published as a federal information
processing standard (FIPS 180) in 1993
• Was revised in 1995 as SHA-1
• Based on the hash function MD4 and its design closely models
MD4
• Produces 160-bit hash values
• In 2002 NIST produced a revised version of the standard that
defined three new versions of SHA with hash value lengths of 256,
384, and 512
• Collectively known as SHA-2
Table 3
Comparison of SHA Parameters
Note: All sizes are measured in bits.
SHA-3
SHA-1 has not yet been "broken”
• No one has demonstrated a technique for
producing collisions in a practical amount of
time
• Considered to be insecure and has been
phased out for SHA-2
NIST announced in 2007 a competition for
the SHA-3 next generation NIST hash SHA-2 shares the same structure and
function mathematical operations as its
predecessors so this is a cause for
• Winning design was announced by NIST
concern
in October 2012
• SHA-3 is a cryptographic hash function • Because it will take years to find a
that is intended to complement SHA-2 suitable replacement for SHA-2 should
as the approved standard for a wide it become vulnerable, NIST decided to
range of applications begin the process of developing a new
hash standard
Table 4
SHA-3 Parameters
Further Reading
1. Network Security Essentials: Applications and
Standards, William Stallings
2. Cryptography and Network Security - Principles and
Practice | Seventh Edition |By Pearson, William,
Stallings
THANK YOU
For queries
Email: [email protected]