Patentable/Patents/US-10721056
US-10721056

Key processing method and device

PublishedJuly 21, 2020
Assigneenot available in USPTO data we have
Inventorsnot available in USPTO data we have
Technical Abstract

An attack on an RSA encryption algorithm based on simple power analysis (SPA) is thwarted by scrambling the sliding window sequence that results from performing sliding window processing on a power exponent. The sliding window sequence is scrambled with a random code that is utilized to determine an adjustment tendency and an adjustment length.

Patent Claims
20 claims

Legal claims defining the scope of protection, as filed with the USPTO.

1

1. A method for processing a key, comprising: acquiring a sliding window sequence of the key by performing a sliding window traversal on the key, the sliding window sequence including a plurality of sliding windows; scrambling one or more sliding windows in the sliding window sequence acquired from performance of the sliding window traversal on the key to obtain a scrambled sliding window sequence that represents a randomly changed distribution of the one or more sliding windows relative to the sliding window sequence; and traversing the scrambled sliding window sequence, and Montgomery modular multiplying the scrambled sliding window sequence.

2

2. The method of claim 1 , wherein the scrambling one or more sliding windows includes: acquiring a random code; determining adjustment parameters based on the random code, the adjustment parameters including an adjustment tendency and an adjustment length; and adjusting a window length of the one or more sliding windows in the sliding window sequence based on the adjustment parameters so as to obtain the scrambled sliding window sequence.

3

3. The method of claim 2 , wherein the determining the adjustment parameters based on the random code includes: judging whether a value of the random code satisfies a preset condition; if the value of the random code satisfies the preset condition, determining whether the adjustment tendency is increasing a sliding window length or decreasing the sliding window length; and determining an adjustment length based on the random code according to a range that the value of the random code is in.

4

4. The method of claim 2 , wherein after the determining the adjustment parameters based on the random code, the method further includes: judging whether the adjustment parameters satisfy at least one condition from: the adjustment length does not exceed a window length of a sliding window; and a corresponding sliding window exists at an adjustment position determined by the adjustment length; and if any one or more of the conditions is satisfied, adjusting the sliding window sequence based on the adjustment parameters.

5

5. The method of claim 2 , wherein after the adjusting the window length of the one or more sliding windows in the sliding window sequence based on the adjustment parameters, the method further includes: acquiring a difference between a number of windows in the sliding window sequence and a number of sliding windows in the scrambled sliding window sequence; if the difference exceeds a first predetermined threshold, modifying the adjustment tendency; and redetermining an adjustment length of the random code based on the modified adjustment tendency so as to obtain corrected adjustment parameters.

6

6. The method of claim 1 , wherein the traversing the scrambled sliding window sequence, and Montgomery modular multiplying the scrambled sliding window sequence includes: judging whether a sliding window length in the scrambled sliding window sequence exceeds a predetermined value; if the sliding window length exceeds the predetermined value, performing modular squaring processing on bits having a bit value of 0 in a sliding window to obtain a value after squaring and modulo; if the value after squaring and modulo exceeds a second predetermined threshold, adjusting the sliding window length; and returning to perform the scrambling processing on the sliding window sequence with which the sliding window length is adjusted.

7

7. The method of claim 6 , further comprising: if the sliding window length does not exceed the predetermined value, extracting sliding window factors in the scrambled sliding window sequence; and modular squaring and modular multiplying the sliding window factors to obtain a second value after multiplication and modulo.

8

8. The method of claim 1 , further comprising, prior to the acquiring the sliding window sequence of the key, generating a random code by a random code generator, wherein the scrambling is based on the random code.

9

9. The method of claim 1 , wherein the acquiring the sliding window sequence of the key includes: acquiring a binary sequence of the key; and performing the sliding window traversal on the binary sequence and calculating to obtain a length of each sliding window, wherein multiple sliding windows form the sliding window sequence.

10

10. The method of claim 9 , wherein the performing the sliding window traversal on the binary sequence and the calculating to obtain the length of each sliding window includes: performing window sliding from a first preset position to a second preset position of the binary sequence using a sliding window having a preset window length; ending window sliding when the sliding window runs into a situation where a bit has a value of 1, and continuing performing window sliding on the binary sequence from an end position until the entire binary sequence is traversed; and performing statistics on the length of each sliding window and making a calculation to obtain the sliding window sequence.

11

11. A key processing device, comprising: a memory; a processor coupled to the memory, the processor to execute instructions stored in the memory to: acquire a sliding window sequence of the key by performing a sliding window traversal on the key, the sliding window sequence including multiple sliding windows; scramble one or more sliding windows in the sliding window sequence acquired from performance of the sliding window traversal on the key to obtain a scrambled sliding window sequence that represents a randomly changed distribution of the one or more sliding windows relative to the sliding window sequence; and traverse the scrambled sliding window sequence to perform post-processing on the scrambled sliding window sequence using a Montgomery modular multiplier.

12

12. The device of claim 11 , wherein performance of the scramble the one or more sliding windows by the processor includes the processor operable to execute instructions stored in the memory to: acquire a random code; determine adjustment parameters based on the random code, the adjustment parameters including an adjustment tendency and an adjustment length; and adjust a window length of the one or more sliding windows in the sliding window sequence based on the adjustment parameters so as to obtain the scrambled sliding window sequence.

13

13. The device of claim 12 , wherein performance of the determine the adjustment parameters based on the random code by the processor includes the processor operable to execute instructions stored in the memory to: judge whether a value of the random code satisfies a preset condition; if the value of the random code satisfies the preset condition, determine whether the adjustment tendency is increasing a sliding window length or decreasing the sliding window length; and determine an adjustment length based on the random code according to a range that the value of the random code is in.

14

14. The device of claim 12 , wherein after performance of the determine the adjustment parameters based on the random code by the processor, further comprising the processor operable to execute instructions stored in the memory to: judge whether the adjustment parameters satisfy at least one condition from: the adjustment length does not exceed a window length of a sliding window; and a corresponding sliding window exists at an adjustment position determined by the adjustment length; and if any one or more of the conditions is satisfied, adjust the sliding window sequence based on the adjustment parameters.

15

15. The device claim 12 , wherein after performance of the adjust the window length of the one or more sliding windows in the sliding window sequence based on the adjustment parameters by the processor, further comprising the processor operable to execute instructions stored in the memory to: acquire a difference between a number of windows in the sliding window sequence and a number of sliding windows in the scrambled sliding window sequence; if the difference exceeds a first predetermined threshold, modify the adjustment tendency; and redetermine an adjustment length of the random code based on the modified adjustment tendency so as to obtain corrected adjustment parameters.

16

16. A non-transitory computer-readable medium having computer executable instructions for performing a method for processing a key, the method comprising: acquiring a sliding window sequence of the key by performing a sliding window traversal on the key, the sliding window sequence including a plurality of sliding windows; scrambling one or more sliding windows in the sliding window sequence acquired from performance of the sliding window traversal on the key to obtain a scrambled sliding window sequence that represents a randomly changed distribution of the one or more sliding windows relative to the sliding window sequence; and traversing the scrambled sliding window sequence, and Montgomery modular multiplying the scrambled sliding window sequence.

17

17. The non-transitory computer-readable medium of claim 16 , Wherein the scrambling the one or more sliding windows includes: acquiring a random code; determining adjustment parameters based on the random code, the adjustment parameters including an adjustment tendency and an adjustment length; and adjusting a window length of the one or more sliding windows in the sliding window sequence based on the adjustment parameters so as to obtain the scrambled sliding window sequence.

18

18. The non-transitory computer-readable medium of claim 17 , wherein the determining the adjustment parameters based on the random code includes: judging whether a value of the random code satisfies a preset condition; if the value of the random code satisfies the preset condition, determining whether the adjustment tendency is increasing a sliding window length or decreasing the sliding window length; and determining an adjustment length based on the random code according to a range that the value of the random code is in.

19

19. The non-transitory computer-readable medium of claim 17 , wherein after the determining the adjustment parameters based on the random code, the method further includes: judging whether the adjustment parameters satisfy at least one condition from: the adjustment length does not exceed a window length of a sliding window; and a corresponding sliding window exists at an adjustment position determined by the adjustment length; and if any one or more of the conditions is satisfied, adjusting the sliding window sequence based on the adjustment parameters.

20

20. The non-transitory computer-readable medium of claim 17 , wherein after the adjusting the window length of the one or more sliding windows in the sliding window sequence based on the adjustment parameters, the method further includes: acquiring a difference between a number of windows in the sliding window sequence and a number of sliding windows in the scrambled sliding window sequence; if the difference exceeds a first predetermined threshold, modifying the adjustment tendency; and redetermining an adjustment length of the random code based on the modified adjustment tendency so as to obtain corrected adjustment parameters.

Classification Codes (CPC)

Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.

Patent Metadata

Filing Date

December 19, 2017

Publication Date

July 21, 2020

Want to explore more patents?

Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.

Citation & reuse

Analysis on this page is generated by Patentable — an AI-powered patent intelligence platform. AI-generated summaries, explanations, and analysis may be reused with attribution and a visible link back to the canonical URL below. Patent abstracts and claims are USPTO public domain.

Cite as: Patentable. “Key processing method and device” (US-10721056). https://patentable.app/patents/US-10721056

© 2026 Patentable. All rights reserved.

Patentable is a research and drafting-assistant tool, not a law firm, and does not provide legal advice. Documents we generate are drafts for review by a licensed patent attorney.