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/ 17
Hash Function, DH Algorithm
Ammar Ali Qazi
Welcome!! Insert the title of your subtitle Here Hash Functions • Mapping of variable sized input data in to a fixed sized data • One way function that cannot be revert • The output is called “Digest” Hash Algorithms MD-5: 512-bit block, 128-bit hash Secure Hash Algorithm (SHA) SHA-1: 512-bit block, 160-bit hash SHA-224: 512-bit block, 224-bit hash SHA-256: 512-bit block, 256-bit hash SHA-384: 1024-bit block, 384-bit hash SHA-512: 1024-bit block, 512-bit hash Applications of Hash Functions Password Storage • Hash function provides protection to the password storage • Instead of storing password in plain text, passwords are stored in form of Hashes so that no body can guess the actual password Application [Cont..] Data Integrity • Data integrity is the most common application of Hash functions Example: • Create a text file in Notepad and save as “test”. Below shows the content of the text file Example [cont..] • Open Command prompt and run “Certutil” command to apply Hash function as shown below
Note: The above command calculates the
hash value for SHA1 i.e. 160Bit Example [cont..]
• Make a small change in the text and put a little
dot at the end as shown below Example [cont..] • Calculate the Hash again
Note that just by adding a single dot has
changed the entire Hash value DH Algorithm Diffie-Hellman Key Exchange • Used to generate a common secret (symmetric) key Alice generates a large Bob generates a large random number x random number y gx mod n
gy mod n
key = gxy mod n
Example: g=3 n=7 Alice secret integer = x=2 Bob’s secret integer = y = 3
Alice calculates gx mod n and send it to Bob
i.e. 32 mod 7 = 2
Bob calculates gy mod n and send it to Alice
33 mod 7 = 6
Alice now calculate (gy mod n) x mod n = 62 mod 7 = 1
Bob also calculate the same at his end i.e. 23 mod 7 = 1
Both came up with same value that is 1
Therefore the secret key will be 1
By using DH formula
Key = gx y mod n = 32*3 mod 7 = 729 mod 7 = 1
Digital Signature Application Private/Public Key pair and Hash Function: A public key is used to verify the digital signa- ture Digital Signature Process • The signer calculates the hash for the data he needs to sign • The signer, using his private key, encrypt the hash calculate. • Signer sends the original data and the digital signature to the receiver • The document is in clear text but it has the signature of the sender and can be sent so that it can be read by anyone but not altered • For the verification, The receiving software first uses the signer’s public key to decrypt the hash • The receiving software will generate the new Hash and compare it with the original Hash • If the two hashes match, the data has not changed since it was signed. Thank you Insert the title of your subtitle Here