Question 16.57

27. Suppose a correctly coded credit card number is modified in such a way that the sum produced by the Luhn algorithm is increased by 10. Explain why the credit card error detection method does not detect the error. What happens if the sum is increased by 12?

27.

The Luhn algorithm for a valid credit card results in a running total that ends with 0, so increasing the sum by 10 would still give a total that ends with 0. Thus, the new number is valid. Increasing the sum by 12 changes the last digit of the running total to 2, which is not a valid credit number.