Cryptographic Hash Functions
Use of Cryptography in Blockchain
• To protect user privacy.
• To protect transaction information.
• To protect ensure data consistency.
• To encode the rules for creation of new units of the currency into a
mathematical protocol.
• To utilize many advanced Cryptographic Techniques and Algorithm’s
into the blockchain network.
Hashing Algorithms
• A hash function is an algorithm that generates a fixed-length result or
hash value from a specific input data. It is different from encryption
which converts plain text to encrypted text and with the help of
decryption, converts the encrypted text back to the original plain
text.
• Types - RipeMD, Tiger, xxhash, MD5, SHA-2,CRC32 etc.
• Hashing algorithm – properties
• - plain text of any size - is converted into a fixed size hashed text through a
cryptographic hash function
• Efficiently computable
• - difficult for hackers to make sense of it. (A hash length of 160 to 512 bits is
good).
• - it doesn’t provide a way to go back to the original text.
Security properties
• Property1: Collision Resistance
• Property2: Pre-image resistance (hiding)
• Property3: Second Pre-image resistance
• Property4: Avalanche effect
• Property5: Deterministic
• Property6: Computational Efficient
1. Collision‐resistance.
• The first property that we need from a cryptographic hash function is
that it’s collision‐resistant. A collision occurs when two distinct inputs
produce the same output.
• A hash function H(.) is collision‐resistant if nobody can find a collision
• The number of inputs exceeds the number of outputs, we are
guaranteed that there must be at least one output to which the hash
function maps more than one input.
Collision-Resistance
• Means it should be hard to find two different inputs of any length
that result in the same hash. This property is also referred to as
collision free hash function.
• Since, hash function is compressing function with fixed hash length, it
is impossible for a hash function not to have collisions. This property
of collision free only confirms that these collisions should be hard to
find.
• This property makes it very difficult for an attacker to find two input
values with the same hash.
Example
Birthday Paradox – Finding collisions
• if you gather up 20-30 people in one room, the odds of two people sharing the
exact same birthday rises up astronomically. In fact, there is a 50-50 chance for 2
people of sharing the same birthday in this scenario!
• assuming that all days of the year have the same likelihood of having a
birthday, the chances of another person sharing your birthday is 1/365 which is
a 0.27%.
• Collision‐detection algorithm works for every hash function – takes a
long time.
• Hash function with a 256‐bit output, you would have to compute the
hash function 2 ^256 + 1 times in the worst case, and about 2^128
times on average.
• There are no hash functions proven to be collision‐resistant.
2. Pre-image resistance (Hiding)
• we’re given the output of the hash function y = H(x) , there’s no
feasible way to figure out what the input, x , was.
• Hiding. A hash function H is hiding if: when a secret value r is chosen
from a probability distribution that has high min‐entropy , then given
H(r ‖ x) it is infeasible to find x .
• min‐entropy is a measure of how predictable an outcome is, and high
min‐entropy captures the intuitive idea that the distribution (i.e.,
random variable) is very spread out.
Example
3. Second Pre-image resistance
Example
4. Avalanche Effect
Example 1:
Example 2:
5. Deterministic
Example:
6. Computational Efficient
Secure Hash Algorithm
• SHA originally designed by NIST in 1993
• Revised in 1995 as SHA-1
• versions of SHA
• SHA-224, SHA-256, SHA-384, SHA-512
SHA-256 hash function
Merkle – Damgard Scheme

2 Cryptographic_Hash_Functions.pptx

  • 1.
  • 2.
    Use of Cryptographyin Blockchain • To protect user privacy. • To protect transaction information. • To protect ensure data consistency. • To encode the rules for creation of new units of the currency into a mathematical protocol. • To utilize many advanced Cryptographic Techniques and Algorithm’s into the blockchain network.
  • 3.
    Hashing Algorithms • Ahash function is an algorithm that generates a fixed-length result or hash value from a specific input data. It is different from encryption which converts plain text to encrypted text and with the help of decryption, converts the encrypted text back to the original plain text. • Types - RipeMD, Tiger, xxhash, MD5, SHA-2,CRC32 etc.
  • 5.
    • Hashing algorithm– properties • - plain text of any size - is converted into a fixed size hashed text through a cryptographic hash function • Efficiently computable • - difficult for hackers to make sense of it. (A hash length of 160 to 512 bits is good). • - it doesn’t provide a way to go back to the original text.
  • 6.
    Security properties • Property1:Collision Resistance • Property2: Pre-image resistance (hiding) • Property3: Second Pre-image resistance • Property4: Avalanche effect • Property5: Deterministic • Property6: Computational Efficient
  • 7.
    1. Collision‐resistance. • Thefirst property that we need from a cryptographic hash function is that it’s collision‐resistant. A collision occurs when two distinct inputs produce the same output. • A hash function H(.) is collision‐resistant if nobody can find a collision
  • 8.
    • The numberof inputs exceeds the number of outputs, we are guaranteed that there must be at least one output to which the hash function maps more than one input.
  • 10.
    Collision-Resistance • Means itshould be hard to find two different inputs of any length that result in the same hash. This property is also referred to as collision free hash function. • Since, hash function is compressing function with fixed hash length, it is impossible for a hash function not to have collisions. This property of collision free only confirms that these collisions should be hard to find. • This property makes it very difficult for an attacker to find two input values with the same hash.
  • 12.
  • 14.
    Birthday Paradox –Finding collisions • if you gather up 20-30 people in one room, the odds of two people sharing the exact same birthday rises up astronomically. In fact, there is a 50-50 chance for 2 people of sharing the same birthday in this scenario! • assuming that all days of the year have the same likelihood of having a birthday, the chances of another person sharing your birthday is 1/365 which is a 0.27%.
  • 15.
    • Collision‐detection algorithmworks for every hash function – takes a long time. • Hash function with a 256‐bit output, you would have to compute the hash function 2 ^256 + 1 times in the worst case, and about 2^128 times on average. • There are no hash functions proven to be collision‐resistant.
  • 16.
    2. Pre-image resistance(Hiding) • we’re given the output of the hash function y = H(x) , there’s no feasible way to figure out what the input, x , was. • Hiding. A hash function H is hiding if: when a secret value r is chosen from a probability distribution that has high min‐entropy , then given H(r ‖ x) it is infeasible to find x . • min‐entropy is a measure of how predictable an outcome is, and high min‐entropy captures the intuitive idea that the distribution (i.e., random variable) is very spread out.
  • 18.
  • 20.
  • 21.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
    Secure Hash Algorithm •SHA originally designed by NIST in 1993 • Revised in 1995 as SHA-1 • versions of SHA • SHA-224, SHA-256, SHA-384, SHA-512
  • 30.
  • 31.