Luhn Algorithm Implementation On Android in Credit Card Authentication
Luhn Algorithm Implementation On Android in Credit Card Authentication
Abstract - High mobility of people who validating a credit card they have is on
currently makes a person unable to mobile phones based on Android.
perform any transaction in a bank or
through another financial institution. One 2. CREDIT CARD
of the tools used in the transaction is a Credit card is the payment system
credit card. Taking the advantage of in which the issuer card lending money to
emerging technologies, it can be made an customers (cardholders) to be paid to the
application that can provide information to payee transactions with credit card
credit card users about the authenticity of (merchant). A credit card is different from
the credit card they have. By applying the a debit card, because credit cards do not
concept of the Luhn algorithm can be remove or reduce the money from
made an application on the Android customer's account after the transaction.
mobile phone operating system so it does Almost all credit cards have the same
not impede the mobility of its users. Luhn shape and size, in accordance with ISO
algorithm is an algorithm that is simple yet 7810 standard specifications [5].
powerful enough to guarantee a credit card
number is valid or not. 2.1 Anatomy of Credit Card
Credit cards are more familiar with
Keywords: Authentication, Credit Card, credit card or in the cyber world called CC
Luhn algorithm, Android. is a plastic card containing a magnetic
tape. Currently, chip equipped credit cards
1. INTRODUCTION for more secure and easy to use. In figure
Credit cards are one type of plastic 2.1 below will be explained about the
money as bank products are modified to anatomy of a credit card further.
meet the various needs of customers [2].
But viewed in terms of security, credit
card security is still fragile. To be able to
find out the validity of a digit credit card is
needed a simple algorithm which Luhn
algorithm. Because of the influence of
information technology that drives greater
demand for telecommunications services
to create a society that informative, quick,
precise, without blocking the mobility of
users, therefore made an application to
Figure 2.1 Anatomy of a credit card
support the mobility of its users in
From figure 2.1 above can be Table 3.2 Category Issuer Identifier
explained the front of the credit card that
consists of [1]:
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 to
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.
4. 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.
2. IIN (Issuer Identifier Number) 3. LUHN ALGORITHM
The first six digits on credit card Luhn algorithm is an algorithm
numbers (including MII digit) form the used to check the validity of a figure based
issuer identifier, is number of publishers. on the digits that shape it. Check digit
This means the number of credit card method requires 3 (three) steps to prove
issuers that may be is 106 or one million whether a card meets Luhn algorithm
publishers. Some credit card issuers are check digit, for a card with an even
well known and commonly used are as number of digits (example, Visa [16
follows [3]: digits], MasterCard [16 digits], and Novus
[16 digits]) way as follows:
1. Each digit in an odd position Step 1:
(counting digits from the left with Multiplying all odd digits by 2, if the result
the far left is the 1st digit (D01, is more than 9, then the result is minus 9,
D02 ... D16)), multiply the value then add the total. Separate first odd digits.
by 2 (two), if the result is more Then do the surgery times 2 and if the
than 9, then the result is reduced by result is more than 9, then the net result of
9 (nine). Sum all the numbers that 9 then obtained:
have been obtained it. D01 = 7x2 = 14, because more than 9 then
2. Each digit in the position is even, reduced to 9, 14-9 = 5
sum up the number value. D03 = 8x2 = 16, because more than 9 then
3. Sum step 1 and step 2, or in other reduced to 9, 16-9 = 7
words add the digits of the even D05 = 8x2 = 16, because more than 9 then
and odd digits these steps 1. If the reduced to 9, 16-9 = 7
sum of the even-digit value plus D07 = 9x2 = 18, because more than 9 then
the sum of step 1 the result is reduced to 9, 18-9 = 9
divisible by 10 (ten), means the D09 = 5x2 = 10, because more than 9 then
card number is SAH or invalid. reduced to 9, 10-9 = 1
D11 = 3x2 = 6
3.1 Modulo arithmetic D13 = 5x2 = 10, because more than 9 then
Inside there is a Luhn algorithm reduced to 9, 10-9 = 1
called arithmetic modulo arithmetic D15 = 1x2 = 2
operations. Modulo arithmetic (sometimes
called clock arithmetic) is a system of Sum D01 + D03 + D05 + D07 + D09 +
arithmetic for integers where the second D11 + D13 + D15 =
integer is operated until it reaches a certain 5 + 7 + 7 + 5 + 1 + 6 + 1 + 2 = 38
value, namely the modulus (remainder). Step 2:
Suppose a is an integer and m is an Adding all the digits in even positions.
integer> 0. The operation a mod m Step 3:
(pronounced "a modulo m") gives a Sum the results of step 1 with the results of
remainder if divided by m. In other words, step 2 = 38 + 42 = 80.
a mod m = r such that a = MQ + r with 0 ≤ Results from the sum of step 1 to step 2
r <m. Number m is called the modulus or divided by 10.
modulo, and the results of arithmetic Or the results can be written, 80 mod 10 =
modulo m lies in the set {0, 1, 2, ..., m-1}. 0, the result is divisible by 10. And credit
Some examples of operations with the cards can be said to VALID.
modulo operator, 6 mod 8 = 6 (because 6 =
8 · 0 + 6), -39 mod 13 = 0 (because -39 = 4. SYSTEM DESIGN
13 (-2) + 0). If a mod m = 0, then it is said Designing a system for
that a is a multiple of m, which is a implementing Luhn algorithm in
divisible by m. For example, 54 mod 6 = determining the credit card authentication
0, meaning 54 were multiples of 6 [4]. on the mobile phone based on Android
will be illustrated through the following
Example: 7889-8594-5435-5413 usecase diagram.
6. CONCLUSION
The results of the research is the
credit cards can be said valid if it meets the
requirements of the Luhn algorithm that
the end result is congruent with the mod
10. This means that if the results for the
values that can not produce the rest of the
card can be said is valid or invalid. But on
the contrary, if the end result left the rest
or not divisible by 10, the card can not be
said illegal or invalid. Luhn algorithm is
an algorithm that is quite powerful in
Figure 4.2 Display the main menu page validating credit card numbers and is the
first step in preventing a crime to use
Figure 4.2 represents the first time credit cards. Luhn algorithm
the display when the application is run, implementation in credit card
there is a check menu option used to enter authentication is built on the Android
digits that want to prove their authenticity, cellular operating system so it can be used
and About menu that displays the profile
creator application. Then to be able to
anywhere and anytime without blocking [3] Golbguru, How to Generate
the mobility of its users. *Valid* Credit Card Numbers,
2007,
7. REFERENCES http://www.thetaoofmakingmoney.
com/2007/04/12/324.html, (2 Juli
[1] Adiprabowo, Yudha, “Aplikasi 2010).
Aritmetika Modulo dalam Validasi [4] Munir, Rinaldi, Matematika
Nomor Kartu Kredit”, Diskrit, Bandung : Informatika,
http://www.informatika.org/~rinald 2005.
i/Matdis/2007-2008/Makalah/Maka [5] Taufan T, Mohammad, “Aplikasi
lahIF2153-0708-038.pdf, (2 Juli Teori Bilangan dalam
2010). Pembangkitan dan Validasi Nomor
[2] Anggara P, Andi, Tips Belanja Kartu Kredit”,
Hemat dengan Kartu Kredit, http://www.informatika.org/~rinald
Yogyakarta : FlashBooks, 2010. i/Matdis/2007-2008/Makalah/Maka
lahIF2153-0708-041.pdf, (2 Juli
2010).