Giter VIP home page Giter VIP logo

fake-credit-card's Introduction

Fake-credit-card generation/validator

Update:

A JavaScript version is available here: https://github.com/bhuone-garbu/js-credit-card-generator, including demo.

Background

Quick and dirty implementation using Python. DISCLAIMER: This is only meant for "educational" purpose.

This is only generating a fake credit card number that statisfies the Luhn check algorithm which most of the card validation are based upon. So by knowing how the 'mod 10' is applied to validate the card number, we can then add appropriate checksum digit at the end of the number to making the random generation of number appear like a valid credit card number - reverse engineering.

Obviously, we also need to know some basics of card numbering system. Example: a Visa card always starts with 4, American Express starts with 3 and American Express with 5. Discover on the other hand starts with 6011. But even if this initial numbering system are changed, it's not a big deal. The checksum will continue to work as long as we are going to use the Luhn algorithm for card validation.

Wiki has a good simple explanation here on the algorithm:
https://en.wikipedia.org/wiki/Luhn_algorithm

Example

$ ./card_num_generator.py 
Card type: discover,  6011227847324111
Card type: mastercard,  5563218655744379
Card type: americanexpress,  361649892117471
Card type: visa13,  4291416812973
Card type: visa16,  43545942222655110

fake-credit-card's People

Contributors

bhuone-garbu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.