.c
om
cu
u
du
o
ng
th
an
co
ng
CRYPTOGRAPHIC HASH FUNTIONS
CuuDuongThanCong.com
/>
.c
om
Contents
Hash function
2)
Applications of Cryptographic Hash Functions
3)
Simple Hash Functions
4)
Requirements and Security
5)
Secure Hash Algorithm (SHA)
cu
u
du
o
ng
th
an
co
ng
1)
CuuDuongThanCong.com
/>
.c
om
1. Hash function
cu
u
du
o
ng
th
an
co
value, or message digest: h= H(M)
ng
A hash function maps a variable-length message into a fixed-length hash
CuuDuongThanCong.com
/>
.c
om
1. Cryptographic hash function.
A cryptographic hash function is an algorithm for which it is
co
ng
computationally infeasible to find either a data object that maps to a pre-
cu
u
du
o
ng
th
an
specified hash result or two data objects that map to the same hash result
CuuDuongThanCong.com
/>
.c
om
2. Applications Of Cryptographic Hash Functions
ng
Message Authentication
cu
u
du
o
ng
th
an
co
Digital signature
CuuDuongThanCong.com
/>
.c
om
Message Authentication
Message authentication is a mechanism or service used to verify the
co
ng
integrity of a message. Message authentication assures that data received
cu
u
du
o
ng
th
an
are exactly as sent
CuuDuongThanCong.com
/>
cu
u
du
o
ng
th
an
co
ng
.c
om
Message Authentication
CuuDuongThanCong.com
/>
.c
om
Digital signature
The hash value of a message is encrypted with a user’s private key.
co
ng
Anyone who knows the user’s public key can verify the integrity of the
cu
u
du
o
ng
th
an
message that is associated with the digital signature
CuuDuongThanCong.com
/>
.c
om
ng
co
an
th
ng
du
o
u
cu
CuuDuongThanCong.com
/>
.c
om
Other Applications
ng
Hash functions are commonly used to create a one-way password file
cu
u
du
o
ng
th
an
co
Hash functions can be used for intrusion detection and virus detection
CuuDuongThanCong.com
/>
.c
om
3. Simple Hash Functions
ng
Input (message, file,etc.) is viewed as a sequence of n-bit blocks
co
One of the simplest hash functions is the bit-by-bit exclusive-OR (XOR)
cu
u
du
o
ng
th
an
of every block. This can be expressed as:
CuuDuongThanCong.com
/>
cu
u
du
o
ng
th
an
co
ng
.c
om
4. Requirements And Security
CuuDuongThanCong.com
/>
cu
u
du
o
ng
th
an
co
ng
.c
om
5. Secure Hash Algorithm (SHA)
CuuDuongThanCong.com
/>
cu
u
du
o
ng
th
an
co
ng
.c
om
SHA-512
CuuDuongThanCong.com
/>
.c
om
SHA-512
Step 1 Append padding bits: The padding consists of a single 1 bit
co
ng
followed by the necessary number of 0 bits
th
an
Step 2 Append length: A block of 128 bits is appended to the message.
ng
This block is treated as an unsigned 128-bit integer and contains the length
cu
u
du
o
of the original message (before the padding).
CuuDuongThanCong.com
/>
.c
om
SHA-512
Step 3 Initialize hash buffer: A 512-bit buffer is used to hold intermediate
co
ng
and final results of the hash function. The buffer can be represented as
an
eight 64-bit registers (a, b, c, d, e, f, g, h). These registers are initialized to
cu
u
du
o
ng
th
the following 64-bit integers (hexadecimal values):
CuuDuongThanCong.com
/>
.c
om
SHA-512
cu
u
du
o
ng
th
an
co
ng
Step 4 Process message in 1024-bit (128-word) blocks:
CuuDuongThanCong.com
/>
.c
om
SHA-512
Each round also makes use of an additive constant, where indicates one of
cu
u
du
o
ng
th
an
co
ng
the 80 rounds.
CuuDuongThanCong.com
/>
cu
u
du
o
ng
th
an
co
ng
.c
om
SHA-512
CuuDuongThanCong.com
/>
cu
u
du
o
ng
th
an
co
ng
.c
om
SHA-512: Word Expansion
CuuDuongThanCong.com
/>
.c
om
SHA-512
Step 5 Output: After all 1024-bit blocks have been processed, the output
cu
u
du
o
ng
th
an
co
ng
from the Nth stage is the 512-bit message digest.
CuuDuongThanCong.com
/>
.c
om
ng
co
an
th
ng
du
o
u
cu
CuuDuongThanCong.com
/>