Control keys
1
Control key
Codes rarely have an apparent meaning, the risks of errors in writing and copying
are significant.
When entering a number, the three most common types of errors are:
• an incorrect number
• Error in the number of digits
• Swapping two consecutive digits.
2
Control key
• Misidentification can have serious consequences due to the confusion of
individuals.
Example:
• Recording in account 2574 instead of account 2547
We have therefore been led to construct codes whose structure makes it possible
to detect, from the code alone, certain transcription errors.
A control key is introduced to highlight certain input errors and to verify the
accuracy of the coded information.
Auto-detection of errors
When the information is too important, such as certain codes (bank account number,
patient number, SS number, etc.), a control key (consisting of one or more characters)
must be added to them when they are created.
3
Control Keys / Controllable Codes:
- To improve the reliability of a code (identifier), a control key is assigned to
it using an algorithm.
- ,
- Each time the identifier is entered into the information system, its control
key is recalculated in order to verify whether it is correct.
- This control is carried out by computer via control keys.
- This control key consists of one or more characters (letters or numbers).
- It is positioned last in the coded line.
4
Methods
There are many methods for calculating control keys, we will present some of them:
Modulo 10 arithmetic method:
- You must multiply each digit in the code alternately by 1 or 2, starting from the
right.
- We add up the products
- Subtract from the next ten to obtain the key digit.
- The control key is a number.
5
Modulo 23 Letter of Control Method
You have to divide the code by 23. The rest of the division corresponds to a
letter of the alphabet which will be the control key.
Example: 1249 Modulo 23 = 7; Alphabet "H";
so the code with its key is 1249H
Con: Restricted remnant domain, so multiple codes can have the same key.
7
MODULO 97 Method
We must calculate the remainder r of the number by 97.
Key = 97 – r (rest of division)
The control key is a number.
Example: Same Example 2314
The code is: 2314/14
9
Example of the use of the MODULO 97 method
In order to avoid errors during registrations (e.g. during Social Security reimbursements)
In order to avoid errors during registrations (e.g. when reimbursing the
Social Security), the last number (ranks 14 and 15) is a control key.
INSEE number
This number has 13 digits: a1a2... A13 followed by a control key comprising one or two
digits:
We calculate the remainder r of the division of a1a2... a13 by 97 . C = 97 –r
donc C ≡ 97 − a1a2… a13 modulo 97
Definition of the INSEE key: C ≡ 97 – N modulo 97, 0 ≤ C ≤ 96
Control key complement to 9
key= complement to 9 of each code position.
Example: code= 1249
its complement to 9 is 8750; the code with its key is 12498750
Disadvantage:
Although it is a secure method (bijection between codes and keys),
this process leads to doubling the length of the code.
Modulo 9 control key
key= (sum of the digits of the code) MODULO 9.
Example: code=1249
sum of digits = 1+2+4+9= 16 Modulo 9 = 7;
so code with its key is 12497
Con: Doesn't detect two-digit reversal errors.
(ex: 1249 et 1429)
A (whole) number is divisible by 9 if the sum of its digits is divisible by 9
Examples of control keys
For input problems
(certainly not to avoid
counterfeit notes)
Old:
Z10708476264
New banknotes:
Example: EA4562608096
- Replace the letter with a number representing its rank in the alphabet.
- Then add this number with the 11 numbers on the ticket.
- The division of this result by 9 must be equal to 8 (equal to 7 for new tickets).