Timing attacks and solutions for PIN code verification

Source: Internet
Author: User

Timing attacks are common software attacks. The basic idea is to analyze the software processing time changes caused by changes in input data values, so as to reverse push valid data.

BCTC's current security test also includes the Timing attack on the PIN code. Although PIN does not have a sample effect due to the number of retries, it is indeed a hidden danger from the security perspective.

PIN processing is the process of comparing data with standard values. The common comparison method is as follows:

BOOL ArrayCompare (U08 * src, U08 * dst, 2010length) {2010i; for (I = 0; I <length; I ++) {if (src [I]! = Dst [I]) {returnFALSE ;}} returnTRUE ;}

We can see that in this comparison method, the exit cycle time varies with the input data, in theory, a large number of samples can be used to analyze all PIN Data Based on Time Difference. To avoid Timing attacks, it is necessary to modify the comparison method as follows:

BOOL ArrayCompare (U08 * src, U08 * dst, 2010length) {2010i; BOOL res; res = TRUE; for (I = 0; I <length; I ++) {res & = (src [I] = dst [I]);} returnres ;}

After the following modification, the command cycle is not affected by the input data value, avoiding Timing attacks.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.