A kind of decrypts information method based on the timeliness parameter
Technical field
The invention belongs to the decoding technique field, particularly a kind of decrypts information method based on the timeliness parameter.
Background technology
In satellite navigation system or other communication systems, can set up the flow process of encrypt and decrypt usually, can guarantee the data transmission security between user and the satellite (or other devices) like this.It is ciphered data that satellite or other devices are issued user's data, this moment the user handheld terminal corresponding decrypted program is installed, the user to above-mentioned decrypts information after, just can receive corresponding data.
In above-mentioned communication system, corresponding decrypted program does not have time restriction, and the user can use at any time; And in some cases, needing classification to set user's authority, the user has only official hour interior (by its authority) could use decrypted program that information is decrypted, and beyond official hour, the user haves no right to use decrypted program.At this moment, existing satellite navigation system or other communication systems can not satisfy this requirement.
Summary of the invention
The present invention is directed to above-mentioned defective and disclose a kind of decrypts information method based on the timeliness parameter, it may further comprise the steps:
1) A random code and B random code are carried out compose operation and obtain kind of a subcode, kind of subcode is carried out compose operation obtain system's timeliness parameter K;
2) according to the timeliness parameter generating user of system timeliness parameter;
First memory cell, second memory cell, the 3rd memory cell and the 4th memory cell order are successively arranged, more than the data of four cell stores arrange in proper order and just constitute user's timeliness parameter;
The X time is encoded, be about to X and be encoded to 16 ary codes: KLMN, this 16 ary codes is no symbol short, and its length is 2 bytes;
Above-mentioned 16 system sign indicating numbers are carried out cascade 8 times, constitute the character string that a length equals 16 bytes, use P here
XExpression; Then, as working key, adopt aes algorithm to P system's timeliness parameter
XBe encrypted the character string C that obtains 16 bytes
X, i.e. C
X=AES (P
X, K); Deposit KLMN in first memory cell, second memory cell deposits data 00, the three storage in and singly deposits data 00, the four memory cell in and deposit data C in
X, this moment, the data of four cell stores were arranged just formation year user's timeliness parameter in proper order;
To encoding in Y month, soon be encoded to 16 system character string: PQ Y month, then 16 system character strings of X Y month correspondence are: KLMNPQ, the length of PQ is 1 byte, and its value is 00-0c, and wherein 01-0c represents January respectively to December; KLMNPQ is carried out cascade obtain a character string for 5 times, with afterbody cascade 16 system character string: the PQ of this character string, the character string that to obtain a length at last be 16 bytes is used PP here
XYExpression;
With C
XAs working key, adopt aes algorithm to PP
XYBe encrypted the character string CC that obtains 16 bytes
XY, i.e. CC
XY=AES (PP
XY, C
X); Deposit KLMN in first memory cell, second memory cell deposits data PQ in, and the 3rd storage singly deposits data 00, the four memory cell in and deposits data CC in
XY, this moment, the data of four cell stores were arranged just formation month user's timeliness parameter in proper order;
To encoding in Z week, soon be encoded to 16 system character string: ST Z week, then 16 system character strings of X Y month Z week correspondence are: KLMNPQST, the length of ST is 1 byte, its value is 00-04, and wherein 01-04 represented for the 1st thoughtful the 4th week respectively, and KLMNPQST is carried out cascade 4 times, the character string that to obtain a length be 16 bytes is used PPP here
XYZExpression;
With CC
XYAs working key, adopt aes algorithm to PPP
XYZBe encrypted the character string CCC that obtains 16 bytes
XYZ, i.e. CC
XYZ=AES (PPP
XYZ, CC
XY); Deposit KLMN in first memory cell, second memory cell deposits data PQ in, and the 3rd storage singly deposits data ST in, and the 4th memory cell deposits data CCC in
XYZ, the data of four cell stores are arranged in proper order and are just constituted all user's timeliness parameters at this moment;
3) according to user's timeliness parameter generating work limitation parameter;
According to the current time, judge that user's timeliness parameter time corresponding whether in the effective time section, judges namely whether the current time belongs to user's timeliness parameter time corresponding;
If judged result then finishes for not; If judged result is for being, then according to step 2) user's timeliness parameter is carried out dispersion treatment, obtain year user's timeliness parameter, month user's timeliness parameter and all user's timeliness parameters;
Year user timeliness parameter, month user's timeliness parameter and all user's timeliness parameters are activated, obtain the work limitation parameter;
4) use the work limitation parameter as key, enciphered message is decrypted processing.
Described A random code and B random code are two composition variables of kind of subcode.
Described kind of subcode is the composition variable of system's timeliness parameter.
The length of the data of described the 4th cell stores is 16 bytes, 24 bytes or 32 bytes.
Beneficial effect of the present invention is: the present invention uses the work limitation parameter that information is decrypted, thereby has strengthened the fail safe that information is obtained, simultaneously, the invention enables the user can only be in official hour could acquired information; Greatly reduce the possibility of information leakage.
Description of drawings
Fig. 1 is workflow diagram of the present invention;
Fig. 2 is the memory cell schematic diagram of user's timeliness parameter.
Embodiment
Below in conjunction with accompanying drawing, preferred embodiment is elaborated.Should be emphasized that following explanation only is exemplary, rather than in order to limit the scope of the invention and to use.
As shown in Figure 1, a kind of decrypts information method based on the timeliness parameter may further comprise the steps:
1) A random code and B random code are carried out compose operation and obtain kind of a subcode, kind of subcode is carried out compose operation obtain system's timeliness parameter K;
2) according to the timeliness parameter generating user of system timeliness parameter;
As shown in Figure 2, first memory cell, second memory cell, the 3rd memory cell and the 4th memory cell order are successively arranged, more than the data of four cell stores arrange in proper order and just constitute user's timeliness parameter;
The X time is encoded, be about to X and be encoded to 16 ary codes: KLMN, this 16 ary codes is no symbol short, and its length is 2 bytes;
Above-mentioned 16 system sign indicating numbers are carried out cascade 8 times, constitute the character string that a length equals 16 bytes, use P here
XExpression; Then, as working key, adopt aes algorithm to P system's timeliness parameter
XBe encrypted the character string C that obtains 16 bytes
X, i.e. C
X=AES (P
X, K); Deposit KLMN in first memory cell, second memory cell deposits data 00, the three storage in and singly deposits data 00, the four memory cell in and deposit data C in
X, this moment, the data of four cell stores were arranged just formation year user's timeliness parameter in proper order;
For example the production process of year user's Ageing Treatment parameter in 2007 is as follows:
X=”07D7”,?P
X=”?07D707D707D707D707D707D707D707D7”
C
X=AES(P
X,K),
Then year user's Ageing Treatment parameter in 2007 is
To encoding in Y month, soon be encoded to 16 system character string: PQ Y month, then 16 system character strings of X Y month correspondence are: KLMNPQ, the length of PQ is 1 byte, and its value is 00-0c, and wherein 01-0c represents January respectively to December; KLMNPQ is carried out cascade obtain a character string for 5 times, with afterbody cascade 16 system character string: the PQ of this character string, the character string that to obtain a length at last be 16 bytes is used PP here
XYExpression;
With C
XAs working key, adopt aes algorithm to PP
XYBe encrypted the character string CC that obtains 16 bytes
XY, i.e. CC
XY=AES (PP
XY, C
X); Deposit KLMN in first memory cell, second memory cell deposits data PQ in, and the 3rd storage singly deposits data 00, the four memory cell in and deposits data CC in
XY, this moment, the data of four cell stores were arranged just formation month user's timeliness parameter in proper order;
The for example generation of month user's Ageing Treatment parameter in March, 2007
PP
XY=”?07D70307D70307D70307D70307D70303”
CC
XY=AES(PP
XY,?C
X),
Then year user's Ageing Treatment parameter in 2007 is
To encoding in Z week, soon be encoded to 16 system character string: ST Z week, then 16 system character strings of X Y month Z week correspondence are: KLMNPQST, the length of ST is 1 byte, its value is 00-04, and wherein 01-04 represents the 1st thoughtful the 4th week (extending to last day of this month around setting the herein) respectively, and KLMNPQST is carried out cascade 4 times, the character string that to obtain a length be 16 bytes is used PPP here
XYZExpression;
With CC
XYAs working key, adopt aes algorithm to PPP
XYZBe encrypted the character string CCC that obtains 16 bytes
XYZ, i.e. CC
XYZ=AES (PPP
XYZ, CC
XY); Deposit KLMN in first memory cell, second memory cell deposits data PQ in, and the 3rd storage singly deposits data ST in, and the 4th memory cell deposits data CCC in
XYZ, the data of four cell stores are arranged in proper order and are just constituted all user's timeliness parameters at this moment;
The for example generation of all user's Ageing Treatment parameters in the 1st week in March, 2007
PPP
XYZ=”?07D7030107D7030107D7030107D70301”
CCC
XYZ=AES(PPP
XYZ,?C
XY),
Then year user's Ageing Treatment parameter in 2007 is
3) according to user's timeliness parameter generating work limitation parameter;
According to the current time, judge that user's timeliness parameter time corresponding whether in the effective time section, judges namely whether the current time belongs to user's timeliness parameter time corresponding;
If judged result then finishes for not; If judged result is for being, then according to step 2) user's timeliness parameter is carried out dispersion treatment, obtain year user's timeliness parameter, month user's timeliness parameter and all user's timeliness parameters;
Year user timeliness parameter, month user's timeliness parameter and all user's timeliness parameters are activated, obtain the work limitation parameter;
4) use the work limitation parameter as key, enciphered message is decrypted processing.
A random code and B random code are two composition variables of kind of subcode.
Planting subcode is the composition variable of system's timeliness parameter.
The length of the data of the 4th cell stores is 16 bytes, 24 bytes or 32 bytes.