How Credit Card Algorithms Work: The Anatomy of Credit Card Numbers « Null Byte :: WonderHowTo

Have you ever wondered how credit card numbers work? I mean, how theyreallywork? How do they come up with the numbers? Credit cards actually follow a very specific pattern. Let's take a look at how they're set up.Example of a Credit Card Number4485 3151 5882 2849These numbers are split up into various parts that identifiy different things about the credit card (who issued it, etc). These things are: major industry identifier, bank issuer ID, user ID and check number. They correspond to these parts of the number:Number 1 is theMII.Numbers 2-6 are theissuer ID, telling which bank the card is from.Numbers 7 to n-1 are theuser ID.The last number is acheck numberto make the number valid against the checking algorithm.MMIThe major industry identifier tells you what the card is for. Here are the numbers and corresponding meanings.MMI/Digit Value		Category0=		ISO/TC 68 and other industry assignments1= Airlines2= Airlines and other industry assignments3= Travel and entertainment4= Banking and financial5= Banking and financial6= Merchandising and Banking7= Petroleum8= Telecommunications and other industry assignments9= National assignmentIssuer IDThe issuer ID is for identifying which bank owns the card. Here are the bigger companies numbers.Issuer				IdentifierCard NumberLengthDiner's Club/Carte Blanche   300xxx-305xxx, 36xxxx, 38xxxx14American Express                   34xxxx, 37xxxx15VISA                                        4xxxxx13, 16Mastercard                              51xxxx-55xxxx16Discover                                  6011xx                                                  16As you can tell from this chart, my example number is a VISA card.User IDThis number is pretty self-explanatory. The user ID is the identification for who owns the card. With VISA, each bank has 999,999,999 possible card holders. These are given based on availability.Check NumberTo ensure that credit card numbers are valid, a final checking number is appended to each number to ensure that it passes a checking algorithm, otherwise known as theLuhncheck. Let's check to see if my fake number above is a valid credit card number.Checking Number ValidityLet's split up the number I made so that we have an easier time managing the number check.4	4	8	5            	3	1	5	1             	5	8	8 2                	2	8	4	9From the back, double every other number.8 4 (16)	5        6	1 (10)	1         (10)	8 (16)	2       4	8 8	9After, we have to de-concatenate the double-digit numbers and then add them to make one single digit.8 4 7	5             6	1 1	1              1	8 7	2                 4	8 8	9If you add all of the numbers together and they add up to a multiple of10, you have a valid credit card number! If you have any questions, be sure to leave them in the comments below.Follow and Chat with Null Byte!TwitterGoogle+IRC chatWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicensePhoto byAndres RuedaRelatedHow To:Get Unlimited Free Trials Using a "Real" Fake Credit Card NumberHow To:MagSpoof Digitally Clones the Magnetic Stripe of Any Credit CardHow To:Flaw in Hilton's Rewards Program Allows You to Achieve Instant HHonors Gold Status for FreeHow To:Auto-Fill Credit Card Forms Using Your iPhone's Camera in iOS 8How To:Add a Bank Account, Debit Card, or Credit Card to Your PayPalHow To:Add & Remove Debit & Credit Cards for Apple Pay on Your iPhoneHow To:Hack RFID enabled credit card & steal money for cheapHow To:No Knife? Use Your Credit Card to Cut Food InsteadNews:The Best Black Friday Deals on Android Phones from Best Buy, Walmart & MoreHow To:Make the Platonic Solids Out of Playing CardsHow To:Change Your Default Card for Apple Pay So You Never Have to Choose During CheckoutApple Pay Cash 101:What You Need to Get StartedHow To:Apply for Apple Card Right from Your iPhoneHow To:How Hackers Stole Your Credit Card Data in the Cyber Attack on Target StoresHow To:Hack a Skype PasswordHow To:Pack your wallet for an itnernational tripHow To:Send & Receive Apple Pay Cash via Messages on Your iPhoneHow To:Transform Gift Card Balances into Cash from Any ATM with Google WalletApple Pay Cash 101:How to Add Money to Your Card BalanceHow To:Say "Can I use my credit card here?" in ChineseNews:Here's Everything You Should Know About Samsung PayApple Pay Cash 101:The Fees, Limits & Fine Print You Need to Know AboutHow To:Upload, Buy, Send, Receive, & Redeem Almost Any Gift Card on Your PhoneHow To:Unlock a Door with a Credit CardHow To:Build web credit card validation with Ruby on RailsCES 2015:Wocket Digitizes All the Cards in Your Wallet into One Single, Secure CardHow To:Calculate the number of periods it takes to pay off a credit card in ExcelNews:1.5 Million Credit Cards Hacked in the Global Payments Breach: Was Yours One of Them?How To:15 Clever Uses for Expired Debit, Credit, Gift, and Membership CardsHow To:Tell Whether a Credit Card Number Is Valid Just by Looking at ItHow To:Securely & Anonymously Spend Money OnlineHow To:Skip the Pre-Menu Credits in Deus Ex: Human RevolutionThe Job Board:Best all-time job postingHow To:Design Your Own Playing Card SculptureHow To:Exchange Gift Cards for Facebook CreditsGreat Deal:Free Facebook Timeline Business CardsNews:Unmasked caller IDNews:Unmasked caller IDNews:Secure your Wizard Booty!Deal Alert:Get a Free Wireless Charger from Samsung