1 / 0

ELEC332 Presentation HKID & Credit Card Number Verification

ELEC332 Presentation HKID & Credit Card Number Verification . Chan Ka Shing , Yuemin Lu, Tang Shuk Fan . Luhn Algorithm. Created by IBM scientist Hans Peter Luhn Simple checksum formula used to validate identification numbers Many extensions Classical Algorithm Logic

emil
Download Presentation

ELEC332 Presentation HKID & Credit Card Number Verification

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ELEC332 PresentationHKID & Credit Card Number Verification

    Chan Ka Shing, Yuemin Lu, Tang Shuk Fan
  2. Luhn Algorithm Created by IBM scientist Hans Peter Luhn Simple checksum formula used to validate identification numbers Many extensions Classical Algorithm Logic Double the value of every second digit counting from the check digit Sum all the digits Mod 10 XXXXXXXXXXXXX Y X = account number, Y = check digit
  3. Luhn Algorithm Strengths and Weaknesses Detect single-digit error Almost all transposition of adjacent digits except 09 and 90 Detect some twin errors
  4. Credit Card Verification Credit Card pattern 8267 1232 7351 0569 Example: 16-bit Credit Card = Codeword Double every other number, starting with the second number in from the right If a number has two digits, add both digits together
  5. Credit Card Verification Add all numbers together If last digit is a zero, it is a valid credit card number. If not, the credit card number is a fake.
  6. HKID Verification HK digit pattern X9999999/X999999(C) Each letter matches to a corresponding number
  7. HKID Verification Example: C546234(5) 8-bit HKID = Codeword First 7-bit = Message Last bit = Check Bit CheckSum =char[1]*8+char[2]*7+char[3]*6+char[4]*5+char[5]*4+char[6]*3+char[7]*2 =3(C)*8+5*7+4*6+6*5+2*4+3*3+4*2 =138 Check Bit =11-(CheckSum mod 11) = 11-(138mod11) = 5 C546234(5) is a valid HKID.
  8. HKID Verification Assume a single error is represented by e Example: C546e34(5) CheckSum =char[1]*8+char[2]*7+char[3]*6+char[4]*5+e*4+char[6]*3+char[7]*2 =3(C)*8+5*7+4*6+6*5+e*4+3*3+4*2 =130+4e Check Bit =11-(CheckSum mod 11) =11-(130+4e)mod11=11-(9+4e)mod11
  9. HKID Verification If Check Bit == 5 =>11-(9+4e)mod11 = 5 =>(9+4e)mod11 = 6 =>9+4e = 11n+6 n is an positive integer =>e = (11n-3)/4 Single bit error is detected.
More Related