With an increase in online financial interactions, such as online banking and online retail, credit card numbers and other financial account numbers are often transmitted across networks. In some cases, an entity may create a data leak protection program to prevent unauthorized access and transmission of account numbers. For example, network traffic may be analyzed to determine whether it contains account number information. Account numbers, such as credit card numbers, may be designed to pass a Luhn check. A Luhn check may be used to determine whether a consecutive sequence of digits is a potential account number.
In the accompanying drawings, like numerals refer to like components or blocks, The drawings describe example embodiments. The drawings show methods performed in an example order, but the methods may also be performed in other orders. The following detailed description references the drawings, wherein:
In one embodiment, a processor performs a single pass of a list of characters to identify both consecutive sequences of digits of a particular length and to identify which of the sequences of the particular length satisfy a Luhn check. Simultaneously checking for both the length and a Luhn check digit may use fewer computations than other methods. As a result, a system may be able to inspect more lists of characters, such as characters found in additional network packets. In addition, such a method may in some cases be simple enough to implement in hardware.
The processor 104 may be any suitable processor, such as a central processing unit (CPU), a semiconductor-based microprocessor, or any other device suitable for retrieval and execution of instructions. In one embodiment, the apparatus 100 includes logic instead of or in addition to the processor 104. As an alternative or in addition to fetching, decoding, and executing instructions, the processor 104 may include one or more integrated circuits (ICs) or other electronic circuits that comprise a plurality of electronic components for performing the functionality described below. In one implementation, the apparatus 100 includes multiple processors. For example, one processor may perform some functionality and another processor may perform other functionality.
The machine-readable storage medium 102 may be any suitable machine readable medium, such as an electronic, magnetic, optical, or other physical storage device that stores executable instructions or other data (e.g., a hard disk drive, random access memory, flash memory, etc.). The machine-readable storage medium 102 may be for example, a computer readable non-transitory medium. The machine-readable storage medium 102 may include instructions executable by the processor 104.
In one embodiment, the processor 104, such as by executing instructions stored in the machine-readable storage medium 102, evaluates a list of digits to identify in a single pass of the list each of the consecutive sequences of digits of a particular length greater than zero that satisfy a Luhn check. For example, in a single pass of a list of digits 123456789012345, the processor 104 may determine each of the consecutive sequences of length 5 that satisfy the Luhn check.
The processor 104 may perform a single pass of the digits and store information in a storage as the processor 104 analyzes each digit. For example, the processor 104 may perform a partial Luhn check for a digit being evaluated and store the partial Luhn check information 108. The partial Luhn check information 108 may be stored in a storage, such as a volatile or non-volatile storage. The storage may be a storage included in the same electronic device as the processor 104 or may be included in a separate electronic device. For example, the storage may he a local storage or a remote database.
The partial Luhn check information 108 may be any suitable partial Luhn check information. The partial Luhn check information 108 may include information related to a partial Luhn check for multiple digits, such as where a partial Luhn check for a digit may be based on partial Luhn check information related to a digit in a previous position. The partial Luhn check information 108 may be accessed when analyzing the next digit to create the partial Luhn check for that digit. The processor 104 may complete the Luhn check after a proper number of digits have been analyzed. For example, for a selected length of 5 digits, the processor may complete a Luhn check for each position beyond the 5th position. If the completed Luhn check reveals that a sequence of digits of the particular length satisfies the Luhn check, the sequence of digits may he a potential account number. Further processing may be performed to determine if a potential account number is an actual account number.
Beginning at 302, a processor performs a single pass of a list of digits, including determining each consecutive sequence of digits of a selected length within the list that satisfies a Luhn check based on a determined partially executed Luhn check for each position in the list of characters. The processor may be any suitable processor, such as a processor executing instructions stored in a machine-readable storage medium or a processor implemented in hardware. In one implementation, the processor is the processor 104.
The consecutive sequence of digits may be any suitable sequence of digits. In some cases, the digits may be separated by other characters that are skipped during the analysis. For example, 2d9j9 may be evaluated as a consecutive sequence of digits 299. The selected length may be any suitable length. In some cases, there are multiple selected lengths. For example, a particular type of account number may have a length of 10 or 11 digits, and sequences of digits of both lengths may be checked during a single pass through the list of digits.
A Luhn check involves multiplying digits in an even position by 2 for odd length numbers, and multiplying digits in an odd position by 2 for even length numbers. For example, for a number 12345 of length 5, the digits 2 and 4 are multiplied by 2. For a number 123456 of length 6, the digits 1, 3, and 5 are multiplied by 2. As a result, the last digit is not one of the multiplied numbers. For a sample number 4408041234567893 of length 16 each digit in an odd position is multiplied by 2 such that (4*2) 4 (0*2) 8 (0*2) 4 (1*2) 2 (3*2) 4 (5*2) 6 (7*2) 8 (9*2) 3 becomes 8 4 0 8 0 4 2 2 6 4 10 6 14 8 18 3. A Luhn check then involves adding the digits of these resulting numbers. The sum of the digits for the sample number is 8+4+0+8+0+4+2+2+6+4+(1+0)+6+(1+4)+8+(1+8)+3=70. The mod 10 value of the summed result is determined. If the result of the mod 10 operation is 0, then the number passes the Luhn check, if the result of the mod 10 operation is not 0, then the number fails the Luhn check. Because 70 mod 10 equals 0, the sample number 4408041234567893 passes the Luhn check.
The partial Luhn check information may be any suitable partial Luhn check information, such as the partial Luhn check information 108. The partial Luhn check information may include any suitable information related to determining a Luhn check of a sequence of digits. For example, the partial Luhn check may be performed as part of the steps of the Luhn check, such as a step to multiply digits by 2, add digits, or mod a sum by 10.
The partial Luhn check information may be determined for each position the list. For example, for a list of digits 189823, a partial Luhn check may be determined for position 1 for the digit 1, position 2 for the digit 8, position 3 for the digit 9, and continuing for each position in the list. Partial Luhn check information for a digit in a subsequent position may be based on the partial Latin check information of a digit in a previous position. For example, the partially executed Luhn check for the digit 9 in position 3 may be based on the partially executed Luhn check for the digit 8 in position 2.
The partially executed Luhn check information may be used to determine whether a sequence of digits of a particular length satisfies a Luhn check in any suitable manner. Creating the partial Luhn check information may allow each sequence in a list of digits of a particular length that pass a Luhn check to be identified from evaluating each digit once. For example, for a sequence of digits 12345789 for a selected length of 4, the processor may subtract partial Luhn check information related to the digit 4 in the fourth position from the partial Luhn check of the digit 8 in the eighth position. In some cases, the Luhn check may be completed differently depending on whether the selected length is an even or odd number.
Continuing to 304, the processor provides each sequence of digits of the selected length determined to satisfy the Luhn check as potential account numbers. For example, the processor may store the sequences of digits for later access. In one embodiment, the processor performs further processing or transmits the sequences of digits to another electronic device for further processing, such as to determine whether the potential account numbers are actual account numbers. For example, sequences of digits may satisfy a Luhn check even if the sequences are not associated with account numbers. The processor may analyze potential account numbers to determine if they match other patterns indicating a possible account number. For example, a group of the first digits of the account numbers may be compared to sequences of digits used by companies issuing account numbers, such as where company X begins each of its account numbers with 2366. Sequences of digits of the particular length passing the Luhn check that do not match the additional patterns may be determined not to be account numbers.
The processor may send the potential account numbers to a company associated with the potential account numbers. For example, account numbers associated with a particular credit card number may begin with a particular digit or be a particular length. The processor may send each sequence passing the Luhn check to a company that may be associated with the account. The processor may then receive information indicating whether the sent account numbers are actual valid account numbers.
Beginning at 402, a processor determines a partial Luhn check for the current position by determining the sum of the digit in the current position, double the digit one position prior to the current position, and the partial Luhn check of a digit two positions prior to the current position. The processor may read in each digit in the list and process it. The operation may be performed differently for the first and second positions. If the current position is in the first position in the list, the partial Luhn check may be the first digit. If the current digit is in the second position in the list, the partial Luhn check may be based on the digit in the second position, double the digit in the first position, and a zero value for the partial Luhn check of two positions prior to the second position. The partial Luhn information may be stored, such as in an array list, or other data structure, such as a PartialLuhn[] array where each position in the array represents a position in the list of digits. For example, PartialLuhn[2] may represent the partial Luhn information for a second position in a list of digits. Other operations may also be performed. For example, other steps may be added. In some cases the steps may be performed in a different order.
As an example, for a list of digits 12345, PartialLuhn[0]=0, PartialLuhn[1]=1, PartialLuhn[2]=PartialLuhn[0]+2*1+2=4. PartialLuhn[3]=PartialLuhn[1]+2*2+3=8, and PartialLuhn[4]=PartialLuhn[2]+2*3+4=14. The partial Luhn information for 5 may be broken down as the following to show that partial Luhn information represents multiplying every other digit by 2:
PartialLuhn[5]=PartialLuhn[3]+2*4+5
PartialLuhn[5]=PartialLuhn[1]+2*2+3+2*4+5
PartialLuhn[5]=1+2*2+3+2*4+5
Proceeding to 404, the processor adjusts the partial Luhn check where the digit in the current position is greater than four. For example, an operation may be performed to adjust multiple digit results of the doubling operation. When multiplying a number by 2, the processor may use the individual digits for the sum instead of the result for double digit results. In one embodiment, the processor uses the result of the doubling operation and adds one to the result if the number multiplied by two is greater than 4. For example, for each 5*2=10, 6*2=12, 7*2=14, 8*2=16, 9*2=18, the result includes a 1 that would be added to the sum. A mod 10 operation involves determining whether a right most digit in a number is a zero. Adding a 1 instead of adding the two digits that result from the multiplication may result in a different total number, but the right most digit that is considered in the mod 10 operation remains the same with either method of adjusting for numbers greater than 4.
Moving to 406, the processor completes the Luhn check for the current position if the number of positions prior to the current position is greater than a length to determine whether a consecutive sequence of digits of the length ending with the digit in the current position passes the Luhn check. The Luhn check may be completed during the evaluation of a position where the current position is greater than the length. For example, for a list of digits 1234839092, if the current position is the 8th position and the determined length is 7, the processor may complete the Luhn check for the sequence 2348390 of 7 consecutive digits where the 0 in the 8th position is evaluated.
The Luhn check may be completed in any suitable manner. The completed Luhn check may be based on a determined partial Luhn check. In one embodiment, the method for completing the Luhn check depends on whether the selected length is even or odd. For example, for an even length, the partial Luhn check of a digit the selected length from the current position may be subtracted from the partial Luhn check of the digit in the current position. For an odd length, the partial Luhn check of a digit one less than the selected length from the current position may be subtracted from the partial Luhn check of the digit in the current position, and then the digit in a position one less than the selected length from the current position may be added.
After the calculation of any relevant completed Luhn checks for the current position, the current position may he updated to the next position in the list of digits, and the processor may then determine partial Luhn check information for the new current position. This is illustrated in
At 506, a processor determines partial Luhn information if i is greater than 1. The partial Luhn information includes: PartialLuhn[i−2]+2 * list[i−1]+list[i]. The list[i] value is the digit in the current position. The list[i−1] is the digit in the previous position which is multiplied by 2. The PartialLuhn[i−2]is equal to the PartialLuhn value associated with the digit in two positions prior to the current position. In some cases, the processor may adjust the PartiaiLuhn[i] to account for double digit numbers multiplied by 2. For example if the digit in the position list[i−1] that was multiplied by 2 is greater than 4, the processor may add 1 to the PartialLuhn[i].
A processor may continue to determine the partial Luhn information for each position in the list. When the number of evaluated digits reaches 14, one of the selected lengths, the processor may complete a Luhn check to determine if the list of 14 digits ending with the current digit satisfies a Luhn check. At 508, the processor determines whether i is greater than 13 to determine if more than 13 digits have been evaluated. If i is greater than 13, the processor performs a Luhn check of Luhn14=(PartialLuhn[i]−PartialLuhn[i−14]) % 10. The partial Luhn check for the 14th position prior to the current position is subtracted so that Luhn14 is determined by the value of 14 consecutive digits. If Luhn14 equals 0, it indicates that the sequence of 14 consecutive digits ending with the current digit satisfies the Luhn check. The sequence may be an account number. Each time the processor evaluates a digit where i is greater than 14, the processor determines whether the sequence of 14 consecutive digits ending with the current digit passes the Luhn check.
At 510, a processor determines whether a sequence of 15 consecutive digits ending with the current digit satisfies a Luhn check. if i is greater than 14, the processor determines both whether the sequence of 14 and 15 consecutive digits ending with the current digit satisfy a Luhn check. A Luhn15 value equals Luhn14+list[i−14]. For odd length sequences of digits, the Luhn check involves multiplying even numbered digits by two. Instead of subtracting the PartialLuhn[i−15] from the current PartialLuhn value, the Luhn check may be determined by adding the Luhn14 digit to the digit prior to the digits included in the Luhn14 partial Luhn information such that the first digit is not multiplied by 2. If Luhn15 % 10 is equal to zero, the processor may report that the sequence of 15 consecutive digits ending with the current digit satisfies a Luhn check. The sequence satisfying the Luhn check may or may not be an account number, but the fact that a sequence passes the Luhn check may indicate that a sequence of consecutive digits should be analyzed further to determine if it is a valid account number.
At 512, the processor checks whether the sequence of 16 consecutive digits ending with the current digit satisfies the Luhn check. The processor may check whether i is greater than 15. If it is greater than 15, the processor may determine a Luhn16 value equal to (PartialLuhn[i]−PartialLuhn[i−16]) % 10. The Luhn16 value may be based on the partial Luhn information of the current position subtracting out partial Luhn information more than 16 positions prior to the current position. A mod 10 operation may then be performed on the result. If the Luhn16 value equals zero, the processor may report that the sequence of 16 consecutive digits ending with the current digit passes the Luhn check. The sequences passing, the Luhn check may be account numbers. The method 500 may then continue to 504 to evaluate the next digit in the list.
Beginning at 802, a processor determines if a sequence passing a Luhn check is a valid account number. The processor may be the same or a different processor than the processor that determine whether a sequence passed a Luhn check. In one embodiment, the processor is the processor 104.
The processor may determine if a group of sequences passing a Luhn check are valid account numbers in any suitable manner. For example, the processor may compare a sequence to a known list of account numbers, such as a list of account numbers or hash values stored in a database. In one embodiment, the processor determines an entity, such as a credit card company, associated with the potential account number. For example, credit card numbers starting with a first number may be associated with a first company, and credit card numbers starting with a second number may be associated with a second company. The processor may determine a company associated with a potential account number, and transmit the potential account number to the associated company. The processor may receive information hack from the associated entity indicating whether the potential account number is a valid account number, such as an actual active account number.
Continuing to 804, if determined that a sequence passing a Luhn check is a valid account number, the processor provides an error report. The processor may generate an error report indicating a list of valid account numbers. The report may be transmitted, such as emailed to a network administrator. In some cases, the report may be displayed on a display device.
Determining consecutive sequences of digits of a selected length satisfying a Latin check in a single pass of a list of digits may be simpler and faster than other methods. In some cases, such a method may be simple enough to implement in hardware.
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/US11/22709 | 1/27/2011 | WO | 00 | 5/16/2013 |