Luhn algorithm implementation on
Android in Credit Card Authentication
Introduction
Algorithm
Schema
Example
Check Digit
Output
Conclusion
INTRODUCTION
Background:
Credit card has been used in many transaction
Luhn Algorithm is simple and powerful
Android is complete platform
Scope :
Authenticity for credit card that use Luhn algorithm to calculate the digits of credit card
Applications built on the Android version 1.5
Goal :
Implement the Luhn algorithm into a credit card authentication in Android
INTRODUCTION
1. Card issuer, the name
of the bank as a credit
card issuer.
2. Credit card
number, amounting
to 16 digits.
3. Member since,
month and year of
customers that credit
card holders.
4. Name of credit card
holders,
5. Expiry date,
month and year of
valid credit card.
6. Logo credit
card network.
MII (Major Industry Indentifier)
The first digit of a credit card number is the Major
Industry Identifier (MII), which represents a
category of companies that issue credit cards.
MII represent different categories.
MII Digit Value Issuer Category
0 ISO/TC 68 and other industry assignments
1 Airlines
2 Airlines and other industry assignments
3 Travel and entertainment
4 Banking and financial
5 Banking and financial
6 Merchandizing and banking
7 Petroleum
8 Telecommunications and other industry assignments
9 National assignment
MII (Major Industry Indentifier)
IIN (Issuer Identifier Number)
Issuer Identifier Card Number Length
Diner's Club/Carte Blanche300xxx-305xxx,
36xxxx, 38xxxx14
American Express 34xxxx, 37xxxx 15
VISA 4xxxxx 13, 16
MasterCard 51xxxx-55xxxx 16
Discover 6011xx 16
Account Number
Digits to 7 (seven) up to (n - 1) of the credit cardnumber is a unique account number.
Maximum length of a credit card number is 16digits. Because of 6 (six) first digit is theidentifier number and the last digit is the checkdigit, means the maximum length of the accountnumber is 12 digits.
So, there are 1012 or 1,000,000,000,000possible account numbers.
Check Digits
The last digit of a credit card number is the
check digit. Digits are used to check the
validity of card numbers. The algorithm
most commonly used to check the credit
card number is the Luhn algorithm.
LUHN ALGORITHM SCHEMA
Step 1:
Multiply the odd
digit with 2, if the
result> 9 subtract
9, sum the odd
digits
Step 2:
Sum the Even
Digits
Step 3:
Sum the step 1&2,
If the Result mod
10= 0 (valid), If the
Result mod 10≠ 0
(invalid)
EXAMPLE CHECK DIGIT
7889 8594 5435 5413
5+8+7+9+7+5+9+4+1+4+6+5+1+4+2+3= 80
80 mod 10 = 0
valid
7 8 8 9 8 5 9 4 5 4 3 5 5 4 1 3
7x2
=14
8 8x2=
16
9 8x2
=16
5 9x2
=18
4 5x2=
10
4 3x2
=6
5 5x2=
10
4 1x2
=2
3
14-
9=5
8 16-
9=7
9 16-
9=7
5 18-
9=9
4 10-
9=1
4 6 5 10-
9=1
4 2 3
5 8 7 9 7 5 9 4 1 4 6 5 1 4 2 3
SYSTEM DESIGN
Usecase Diagram
OUTPUT
OUTPUT
CONCLUSION
Credit cards can be said to have been valid ifthe requirement of Luhn algorithm that the endof the result is divisible by 10 (mod 10 = 0)
Luhn algorithm implementation is used as ageneral knowledge and the first step inpreventing a crime to use credit cards
Luhn algorithm implementation can be run onAndroid, so can be used anywhere withoutinterfering the user mobility
THANK YOULuhn algorithm implementation on Android in credit card authentication
Lintang-Nurhayati-Yunufa © Gunadarma University