CN107948170A - Interface requests parameter encryption method, device, equipment and readable storage medium storing program for executing - Google Patents
Interface requests parameter encryption method, device, equipment and readable storage medium storing program for executing Download PDFInfo
- Publication number
- CN107948170A CN107948170A CN201711234907.4A CN201711234907A CN107948170A CN 107948170 A CN107948170 A CN 107948170A CN 201711234907 A CN201711234907 A CN 201711234907A CN 107948170 A CN107948170 A CN 107948170A
- Authority
- CN
- China
- Prior art keywords
- parameter
- interface requests
- interface
- name
- encryption
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/20—Network architectures or network communication protocols for network security for managing network security; network security policies in general
- H04L63/205—Network architectures or network communication protocols for network security for managing network security; network security policies in general involving negotiation or determination of the one or more network security mechanisms to be used, e.g. by negotiation between the client and the server or between peers or by selection according to the capabilities of the entities involved
Abstract
The present invention discloses a kind of interface requests parameter encryption method, device, equipment and readable storage medium storing program for executing, the described method includes:When receiving interface requests parameter, the parameter name of interface requests parameter is obtained, and judges to whether there is the parameter name in preset configuration file;When there are during the parameter name, encipherment scheme corresponding with parameter name is obtained from preset configuration file in preset configuration file;According to the encipherment scheme, interface required parameter is encrypted.This programme obtains encipherment scheme corresponding with parameter name in preset configuration file, this interface requests parameter is encrypted by configuring parameter name and encipherment scheme corresponding with parameter name in preset configuration file.The encipherment scheme by interface requests parameter is avoided to be programmed in program code, reduce the coupling of program code, at the same time because parameter name is corresponding with interface requests parameter, different program codes need not be write for different interface requests parameters by configuring, improve encrypted flexibility.
Description
Technical field
The invention mainly relates to field of communication technology, specifically, is related to a kind of interface requests parameter encryption method, dress
Put, equipment and readable storage medium storing program for executing.
Background technology
The equipment such as computer, mobile phone and server communication can realize multiple functions, and various functions then pass through program code tune
Realized with multiple interfaces.And during interface realizes its function, there are the transmittance process of interface requests parameter.Such as realize net
Page or the registration of APP or the interface of login feature, are required to the information transmission that will be registered or log in registration or login process
Also need to be stored in background system to background system server, and for the user information of registration.Such interface requests parameter
In may relate to the privacy information of user, need to be encrypted before transmission, to ensure its security.But at present
Parameter encryption write on inside program code, the coupling of program code and encipherment scheme is high, and for different interface requests
Parameter needs to write different program codes to realize encryption, and encipherment scheme is dumb.
The content of the invention
The main object of the present invention is to provide a kind of interface requests parameter encryption method, device and readable storage medium storing program for executing, purport
Solving, the coupling of parameter encryption and program code in the prior art is high, the inflexible problem of encipherment scheme.
To achieve the above object, the present invention provides a kind of interface requests parameter encryption method, and the interface requests parameter adds
Decryption method comprises the following steps:
When receiving interface requests parameter, the parameter name of interface requests parameter is obtained;
Judge to whether there is the parameter name in preset configuration file, when there are the parameter name in preset configuration file
When, encipherment scheme corresponding with parameter name is obtained from preset configuration file;
According to the encipherment scheme, interface required parameter is encrypted.
Preferably, it is described when receiving interface requests parameter, obtain interface requests parameter parameter name the step of after
Including:
Judge the interface requests parameter that receives whether be it is multiple, and the parameter name of multiple interface requests parameters whether one
Cause;
When interface requests parameter is multiple, and the multiple interface requests parameter parameter name it is consistent when, obtain each connects
Identifier entrained by mouth required parameter;
According to the identifier of each interface requests parameter, ginseng corresponding with its identifier to each interface requests parameter setting
Number alias;
Corresponding encipherment scheme in preset configuration file is determined according to parameter alias, with according to the encipherment scheme to interface
Required parameter is encrypted.
Preferably, include after described the step of interface required parameter is encrypted according to the encipherment scheme:
Judge whether the encryption of interface requests parameter is completed, when interface requests parameter, which is encrypted, to be completed, by interface requests parameter
Parameter alias delete.
Preferably, it is described when interface requests parameter is multiple, and the multiple interface requests parameter parameter name it is consistent when,
The step of obtaining the identifier entrained by each interface requests parameter includes:
When interface requests parameter is multiple, and the multiple interface requests parameter parameter name it is consistent when, judgement has phase
Whether the encryption requirements of multiple interface requests parameters of same parameter name are consistent;
When the encryption requirements of multiple interface requests parameters with identical parameters name are inconsistent, obtaining please with each interface
Seek the identifier corresponding to the encryption requirements of parameter.
Preferably, it is described when receiving interface requests parameter, obtain interface requests parameter parameter name the step of before
Including:
Acquisition has the parameter name of encryption requirements and encipherment scheme corresponding with parameter name, and by the encipherment scheme with joining
Several be configured in the lump is pre-seted in file, forms encipherment scheme set.
Preferably, it is described according to the encipherment scheme, include after the step of interface required parameter is encrypted:
The encrypted interface requests parameter and corresponding decryption scheme are packaged into data packet and are submitted to default system
System backstage, so that predetermined system backstage obtains resolve packet decryption scheme, predetermined system backstage is according to decryption scheme, docking
Mouth required parameter is decrypted.
In addition, to achieve the above object, the present invention also proposes a kind of interface requests parameter encryption device, the interface requests
Parameter encryption device includes:
Acquisition module, for when receiving interface requests parameter, obtaining the parameter name of interface requests parameter;
Judgment module, for judging to whether there is the parameter name in preset configuration file, is deposited when in preset configuration file
In the parameter name, encipherment scheme corresponding with parameter name is obtained from preset configuration file;
Encrypting module, for according to the encipherment scheme, interface required parameter to be encrypted.
Preferably, the interface requests parameter encryption device further includes:
Judging unit, for judging whether the interface requests parameter that receives is multiple, and multiple interface requests parameters
Whether parameter name is consistent;
Acquiring unit, for being multiple when interface requests parameter, and the parameter name of the multiple interface requests parameter is consistent
When, obtain the identifier entrained by each interface requests parameter;
Setting unit, for the identifier according to each interface requests parameter, to each interface requests parameter setting and its
The corresponding parameter alias of identifier;
Encryption unit, for determining corresponding encipherment scheme in preset configuration file according to parameter alias, with according to
Interface required parameter is encrypted in encipherment scheme.
In addition, to achieve the above object, the present invention also proposes a kind of interface requests parameter encryption device, the interface requests
Parameter encryption device includes:Memory, processor, communication bus and the interface requests parameter that is stored on the memory add
Close program;
The communication bus is used for realization the connection communication between processor and memory;
The processor is used to perform the interface requests parameter encipheror, to realize following steps:
When receiving interface requests parameter, the parameter name of interface requests parameter is obtained;
Judge to whether there is the parameter name in preset configuration file, when there are the parameter name in preset configuration file
When, encipherment scheme corresponding with parameter name is obtained from preset configuration file;
According to the encipherment scheme, interface required parameter is encrypted.
In addition, to achieve the above object, the present invention also provides a kind of readable storage medium storing program for executing, the readable storage medium storing program for executing storage
Have one either more than one program the one or more programs can be held by one or more than one processor
Row for:
When receiving interface requests parameter, the parameter name of interface requests parameter is obtained;
Judge to whether there is the parameter name in preset configuration file, when there are the parameter name in preset configuration file
When, encipherment scheme corresponding with parameter name is obtained from preset configuration file;
According to the encipherment scheme, interface required parameter is encrypted.
The interface requests parameter encryption method of the present embodiment, when receiving interface requests parameter, obtains interface requests ginseng
Several parameter names;And obtained in preset configuration file there are during this parameter name from preset configuration file corresponding with parameter name
Encipherment scheme;According to encipherment scheme, interface required parameter to be encrypted.This programme in preset configuration file by matching somebody with somebody
The parameter name for needing to be encrypted and encipherment scheme corresponding with parameter name are equipped with, when the ginseng of the interface requests parameter received
It is several then to show that this interface requests parameter needs to encrypt in this preset configuration file, obtain preset configuration file in parameter
The corresponding encipherment scheme of name, is encrypted this interface requests parameter.The encipherment scheme by interface requests parameter is avoided to be programmed in
In program code, the coupling of program code is reduced, while in need because being configured with preset configuration file encrypted connect
The correspondence encipherment scheme of mouth required parameter, it is not necessary to write different program codes for different interface requests parameters, improve
Encrypted flexibility.
Brief description of the drawings
Fig. 1 is the flow diagram of the interface requests parameter encryption method first embodiment of the present invention;
Fig. 2 is the flow diagram of the interface requests parameter encryption method second embodiment of the present invention;
Fig. 3 is the flow diagram of the interface requests parameter encryption method 3rd embodiment of the present invention;
Fig. 4 is the high-level schematic functional block diagram of the interface requests parameter encryption device first embodiment of the present invention;
Fig. 5 is that the refinement function module of the judgment module of the interface requests parameter encryption device second embodiment of the present invention is shown
It is intended to;
Fig. 6 is the device structure schematic diagram for the hardware running environment that present invention method is related to.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present invention provides a kind of interface requests parameter encryption method.
Fig. 1 is refer to, Fig. 1 is the flow diagram of interface requests parameter encryption method first embodiment of the present invention.At this
In embodiment, the interface requests parameter encryption method includes:
Step S10, when receiving interface requests parameter, obtains the parameter name of interface requests parameter;
With the development of the communication technology, the application function of types of applications software is more and more, is such as installed on mobile phone or computer
On safety bank, safety easily borrow etc. financing class software, its support function it is stronger and stronger.Each function passes through program code
Realize, in order to facilitate the maintenance of program, API is provided with code, and (Application Programming Interface, should
With Program Interfaces), API is its essence is some pre-defined functions, for application program or application developer
Access the program that this API is set so that application program or application developer need not access the source code of program, or understand in it
Working mechanism of portion is the function of can be achieved or understand code.When realizing some function, there are the transmission of interface requests parameter
Journey, needs log-on message being delivered to background service system when such as logging in safety bank app by login interface, complete on app
Perfect subscriber data can be then delivered in background service system by the operations such as kind subscriber data by the communication interface with backstage
Preserve.The subscriber data that the log-on message or request that this request logs in preserve is interface requests parameter, such interface requests ginseng
Number may relate to the privacy information of user, needs to be encrypted before transmission, was being transmitted to avoid user information
It is compromised in journey.
The interface requests parameter encryption of the present embodiment is used to carry out interface required parameter before background system is delivered to
Encryption.When receiving interface requests parameter, this corresponding parameter name of interface requests parameter is obtained.Parameter name can be characterized and connect
The type of mouthful required parameter, if interface requests parameter is the age 20, then its parameter entitled age.By the configuration of this parameter name default
In configuration file, preset configuration file is the file configured in advance to the parameter name for needing encryption, such as by age class
The parameter name of type is configured in preset configuration file, so that when the parameter for the getting interface requests parameter entitled age, because pre-
If then illustrate that place is encrypted in the interface requests parameter needs at parameter entitled age there are the parameter name at this age in configuration file
Reason.This preset configuration file can use XML format, and it is XML configuration file to make preset configuration file.Will in XML configuration file
Parameter name configures in xml format, generates configuration file, XML (eXtensible Markup Language, extensible markup language
Speech) be it is a kind of be used for mark e-file to make it have structural markup language.Parameter name is configured in XML configuration file
Configuration information, when the change that parameter name increases or decreases, it is only necessary to corresponding to the configuration information in this XML file
Increased or decreased, it is easy to operate.
Step S20, judges to whether there is the parameter name in preset configuration file, described when existing in preset configuration file
During parameter name, encipherment scheme corresponding with parameter name is obtained from preset configuration file;
After the parameter name of interface requests parameter is got, the institute that will be configured in this parameter name and preset configuration file
There is parameter name to compare, to judge to whether there is this parameter name in preset configuration file.Because preset configuration file be used for need into
The parameter name of row encryption is configured, and judges that there are the parameter name of interface requests parameter in preset configuration file so as to work as
When, then interface requests parameter of the explanation with this parameter name needs to be encrypted.The encipherment scheme being wherein encrypted
Corresponding with parameter name in advance to be configured in preset configuration file, i.e., preset configuration file is in advance to needing the parameter of encryption
Name and corresponding encipherment scheme are configured, and the parameter name of age type such as is configured to encipherment scheme A, so that pre- when judging
If there are during parameter name, then certainly exist encipherment scheme corresponding with parameter name in configuration file.According to parameter name from pre- establishing
Put and corresponding encipherment scheme is obtained in file, to be added according to encipherment scheme to the interface requests parameter with parameter name
It is close.
Step S30, according to the encipherment scheme, is encrypted interface required parameter.
After encipherment scheme corresponding with parameter name is got, according to this encipherment scheme, to the interface with this parameter name
Required parameter is encrypted.Encrypted concrete mode is determined by encipherment scheme, as encipherment scheme is:Y=xmModn, wherein y are
Encrypted ciphertext, x are the plaintext before encrypting, and m is public key, and n is private key.In order to ensure encrypted performance, can by public key m and
Private key n is arranged to be determined by random number k, and random number k can be randomly generated by randomizer, can also pass through calculation formula
K=p*q is produced, and p, q are integer.The present embodiment is illustrated in a manner of obtaining random number by p, q, is obtained by p, q
After random number, then determine an intermediate quantity L;L is arranged to the least common multiple of (p-1) and (q-1), i.e., determines intermediate quantity L with this;
Public key m is further determined by intermediate quantity L, public key m is set as that with the greatest common divisor of L be 1, i.e. m and L is relatively prime obtains public key
m;Private key n is obtained according still further to public key m and intermediate quantity L, its relation is m*n mode L=1, thus obtains private key n,
So as to which interface required parameter be encrypted by public key m and private key n.The present embodiment will need encrypted interface requests parameter
Parameter name and corresponding encipherment scheme are configured in preset configuration file, can configure for different types of interface requests parameter
Different encipherment schemes, realizes and different types of interface requests parameter is encrypted by different encipherment schemes, parameter name
It is simple with the configuration of encipherment scheme, the favorable expandability of encipherment scheme.
The interface requests parameter encryption method of the present embodiment, when receiving interface requests parameter, obtains interface requests ginseng
Several parameter names;And obtained in preset configuration file there are during this parameter name from preset configuration file corresponding with parameter name
Encipherment scheme;According to encipherment scheme, interface required parameter to be encrypted.This programme in preset configuration file by matching somebody with somebody
The parameter name for needing to be encrypted and encipherment scheme corresponding with parameter name are equipped with, when the ginseng of the interface requests parameter received
It is several then to show that this interface requests parameter needs to encrypt in this preset configuration file, obtain preset configuration file in parameter
The corresponding encipherment scheme of name, is encrypted this interface requests parameter.The encipherment scheme by interface requests parameter is avoided to be programmed in
In program code, the coupling of program code is reduced, while in need because being configured with preset configuration file encrypted connect
The correspondence encipherment scheme of mouth required parameter, it is not necessary to write different program codes for different interface requests parameters, improve
Encrypted flexibility.
Further, it is described to receive in another embodiment of the interface requests parameter encryption method of the present invention
During mouthful required parameter, include after the step of obtaining the parameter name of interface requests parameter:
Whether step S40, the interface requests parameter for judging to receive are multiple, and the parameter name of multiple interface requests parameters
It is whether consistent;
Understandably, when different user is in a certain application function of same time operation, multiple interface requests can be received
Parameter, and the parameter name of this multiple interface requests parameter may be consistent, such as the age data of m user and n user, both ginsengs
Several is the age.For the identical multiple interface requests parameters of parameter name, it is understood that there may be different encryption requirements, which part
Interface requests parameter needs to encrypt, and another part interface requests parameter need not then encrypt.But for needing encrypted connect
Mouthful required parameter and encrypted interface requests parameter is not required, both parameter names are identical, for phase in preset configuration file
With parameter name encipherment scheme it is identical so that can be not required encrypted interface requests parameter according to its parameter name it is corresponding plus
Operation is encrypted in close scheme.Or in multiple interface requests parameters with identical parameters name, part of interface request is joined
Several encipherment schemes and the encipherment scheme of another part interface requests parameter differ.One of encipherment scheme is complicated, and another
One encipherment scheme is simple.But since both has identical parameter name, and cause both of which to use preset configuration file
In identical encipherment scheme be encrypted.So as to receive interface requests parameter, and obtain the parameter name of interface requests parameter
Afterwards, it is multiple to judge whether this interface requests parameter received has, and whether the parameter name of this multiple interface requests parameter is consistent,
With multiple and different interface requests parameters to the different encryption requirements with identical parameters name, encryption is distinguished.
Step S50, when interface requests parameter is multiple, and the multiple interface requests parameter parameter name it is consistent when, obtain
Take the identifier entrained by each interface requests parameter;
This implementation in order to avoid to identical parameters name and the different multiple interface requests parameters of encryption requirements use
Same encipherment scheme is encrypted, and when receiving multiple interface requests parameters, the interface requests of different encryption requirements are joined
Number is provided with identifier, to identify the different encryption requirements of interface requests parameter.Judge that interface requests parameter is more so as to work as
It is a, and multiple interface requests parameters parameter name it is consistent when, the identifier entrained by each interface requests parameter is obtained, with basis
This identifier obtained, determines different encryption requirements.
Step S60, according to the identifier of each interface requests parameter, to each interface requests parameter setting and its identifier
Corresponding parameter alias;
After the identifier entrained by each interface requests parameter is obtained, encrypted according to this each interface requests parameter of characterization
The identifier of demand, parameter alias corresponding with its identifier to each interface requests parameter setting.Parameter alias is made an appointment
It is arranged in preset configuration text, for distinguishing the name with identical parameters name but the different interface requests parameter of encipherment scheme
Claim.When receiving that multiple parameters name is identical but during the different interface requests parameter of encryption requirements, obtained from preset configuration file
Parameter alias corresponding with identifier is taken, and this parameter alias is set into corresponding interface requests parameter.Different parameters
Alias corresponds to different encipherment schemes, parameter alias and corresponding encipherment scheme equivalent to parameter name and corresponding encipherment scheme
Next stage.
Step S70, determines corresponding encipherment scheme in preset configuration file, with according to the encryption side according to parameter alias
Interface required parameter is encrypted in case.
Further, to each interface requests parameter setting after the corresponding parameter alias of identifier, according to this parameter
Alias determines corresponding encipherment scheme in preset configuration file, and interface required parameter is encrypted.In one embodiment,
The corresponding encipherment scheme of interface requests parameter of the entitled E of parameter is F, when there is the parameter name of three interface requests parameters to be E,
The identifier for getting its carrying is respectively s1, s2 and s3, and wherein s1 is encrypted intermediate scheme, s2 primary encipherment schemes, and s3 is
Do not encrypt, so that according to this identifier and the parameter alias made an appointment, parameter of such as making an appointment alias is by parameter name and respectively
The corresponding identifier combination of interface requests parameter is formed, so that the parameter alias set to interface required parameter is respectively E1, E2
And E3.Encipherment scheme F1 and F2 corresponding with parameter alias E1 and E2 is provided with corresponding preset configuration text, when parameter is other
During entitled E1, then F1 is obtained from encipherment scheme and interface required parameter is encrypted, when parameter alias is E2, then from encryption
F2 is obtained in scheme interface required parameter is encrypted, and when parameter alias is E3, because of no pair in preset configuration document
This parameter alias is configured, and there is no the parameter alias of E3, and the corresponding interface requests parameters of critical parameter alias E3 are not required to
Encrypt, operation it is not encrypted.Realized by parameter alias with identical parameters name but have connecing for different encryption requirements
The encryption of mouth required parameter, can meet different encryption requirements.
Further, in another embodiment of the interface requests parameter encryption method of the present invention, add described in the basis
Include after the step of interface required parameter is encrypted in close scheme:
Step S80, judges whether the encryption of interface requests parameter is completed, when interface requests parameter, which is encrypted, to be completed, by interface
The parameter alias of required parameter is deleted.
Understandably, interface requests parameter is delivered to background system, it is necessary to follow certain transport protocol.Because parameter is other
Entitled identical in parameter name but use in the case that encryption requirements are different, i.e. parameter alias is uses in the case of unconventional.If
By this parameter alias agreement into transport protocol, the workload of establishment transport protocol personnel is on the one hand added, is on the other hand increased
The workload of transmission is added, and and may need not have been used in background system and arrive this parameter alias.So as to the biography of the present embodiment
Defeated agreement is not related to parameter alias, if after the completion of encryption, by parameter alias and encrypted interface requests parameter one
And background system is sent to, background system cannot identify this parameter alias, cause error of transmission.Thus judge interface requests parameter
Encryption whether complete, when interface requests parameter encrypt complete, when can be transferred to background system, first by the ginseng of interface requests parameter
Number alias is deleted, this is transferred to background system through deleting the interface requests parameter of parameter alias and encryption, to ensure to pass
The correctness of defeated interface requests parameter.
Further, it is described to work as interface requests in another embodiment of the interface requests parameter encryption method of the present invention
Parameter to be multiple, and the multiple interface requests parameter parameter name it is consistent when, obtain entrained by each interface requests parameter
The step of identifier, includes:
Step S51, when interface requests parameter is multiple, and the multiple interface requests parameter parameter name it is consistent when, sentence
Whether the encryption requirements of disconnected multiple interface requests parameters with identical parameters name are consistent;
Further, the present embodiment is provided with identifier, to determine for the identical multiple interface requests parameters of parameter name
The encryption requirements of each interface requests parameter.Specifically, when interface requests parameter is multiple, and the multiple interface requests parameter
Parameter name it is consistent when, judge with identical parameters name multiple interface requests parameters encryption requirements it is whether consistent, encryption need
Ask for representing whether interface requests parameter needs the demand of encryption or secret grade.If demand is consistent, illustrate multiple connect
Mouth required parameter is required to encrypt or need not encrypt, and when being required to encryption, then encipherment scheme, i.e. secret grade are consistent.
And if demand is inconsistent, illustrate partly to need to encrypt in multiple interface requests parameters, and another part need not be encrypted;Or
Multiple interface requests parameters are required to encrypt, when required encipherment scheme, i.e. secret grade are inconsistent.By judging identical ginseng
Whether the encryption requirements of several multiple interface requests parameters are consistent, it is determined whether identical encipherment scheme can be used, cannot
In the case of using identical encipherment scheme, then need to set identifier to interface required parameter, to distinguish multiple interface requests
Encipherment scheme between parameter.
Step S52, when the encryption requirements of multiple interface requests parameters with identical parameters name are inconsistent, obtains and each
Identifier corresponding to the encryption requirements of a interface requests parameter.
When the encryption requirements for the multiple interface requests parameters for judging to have identical parameters name are inconsistent, then illustrate multiple
The required encipherment scheme of interface requests parameter is inconsistent, it is necessary to be set according to the specific encryption requirements of each interface requests parameter
Identifier, to identify the different encipherment schemes of each interface requests parameter.Specifically, whether encrypt in UI Preferences and
Secret grade option, the encryption of user's selection or is not encrypted and encryption requirements of the secret grade as interface requests parameter, root
Accordingly as encryption requirements the selected encryption of user or do not encrypt and secret grade gives interface requests parameter setting mark
Know symbol.In addition can also be according to significance level of the interface requests parameter in user information to determine whether needing to set mark
Symbol, this significance level correspond to encryption requirements.When interface requests parameter is more important in user information, then encryption requirements are determined with;Instead
It is more inessential, then judge no encryption requirements.And significance level is judged by pre-setting criterion, when interface please
Parameter is sought in criterion, then illustrate it is important, it is on the contrary then inessential.Criterion is such as set for user certificate piece number, password, year
In age etc., so that it is name, gender to work as the interface requests parameter received, be then determined as that significance level is low, it is not necessary to encrypt, and work as
The interface requests parameter received is user certificate piece number, password, then is determined as significance level height, it is necessary to encrypt.The present embodiment root
Identifier is set according to the specific requirements of user, determines to be used for the encrypted encipherment scheme of interface requests parameter, makes encipherment scheme more
User is bonded, encryption is more accurate.When the encryption requirements for the multiple interface requests parameters for judging to have identical parameters name are inconsistent
When, because having different identifiers to the interface requests parameter setting of different encryption requirements, then obtain and join with this each interface requests
The corresponding identifier of several encryption requirements.According to the otherness of the identifier of acquisition, different encryption requirements are determined.
Further, Fig. 2 is refer to, on the basis of the first embodiment of the interface requests parameter encryption method of the present invention
On, propose the second embodiment of the interface requests parameter encryption method of the present invention, it is in a second embodiment, described to receive
During mouthful required parameter, include before the step of obtaining the parameter name of interface requests parameter:
Step S90, acquisition have the parameter name of encryption requirements and an encipherment scheme corresponding with parameter name, and by the encryption
Scheme is configured in preset configuration file in the lump with parameter name, forms encipherment scheme set.
In order to realize the encryption to interface required parameter, the present embodiment will need encrypted parameters name and with it is each
The corresponding encipherment scheme of parameter name is configured in preset configuration file.Because of different types of interface requests parameter, there is different add
Close demand, such as the higher interface requests parameter of significance level, it is necessary to which complicated encipherment scheme protects it, and for
The relatively low interface requests parameter of significance level, then can use simple encipherment scheme to protect it.Because parameter name represents interface
The type of required parameter, so as to be preset with the parameter name of encryption requirements by program code, and is directed to different parameter names
Set corresponding encipherment scheme.Parameter name and the encipherment scheme corresponding with parameter name that this there are encryption requirements are obtained, will be each
Parameter name and corresponding encipherment scheme are configured to preset configuration file in the lump, form encipherment scheme set.To receive
During mouth required parameter, according to the parameter name of interface requests parameter, encryption corresponding with parameter name is obtained from preset configuration file
Scheme, is encrypted interface required parameter.
Further, Fig. 3 is refer to, on the basis of the second embodiment of the interface requests parameter encryption method of the present invention
On, propose the 3rd embodiment of the interface requests parameter encryption method of the present invention, it is in the third embodiment, described according to institute
Include after the step of stating encipherment scheme, interface required parameter is encrypted:
Step S100, is packaged into data packet by the encrypted interface requests parameter and corresponding decryption scheme and submits
To predetermined system backstage, so that predetermined system backstage parses data to obtain decryption scheme, predetermined system backstage is according to decryption side
Case, is decrypted interface required parameter.
Further, after the completion of the cryptographic operation of interface requests parameter, by the interface requests parameter of this encrypted processing
And corresponding decryption scheme is packaged into data packet and is submitted to predetermined system backstage in the lump, predetermined system is and interface requests parameter
Between there are transitive relation system.Predetermined system backstage obtains resolve packet decryption scheme after data packet is received,
According to this decryption scheme, encrypted interface requests parameter is decrypted.Decryption scheme is corresponding with encipherment scheme, can be to encryption side
Case is decrypted.When setting corresponding encipherment scheme for different parameter names, corresponding decryption is generated according to encipherment scheme
Scheme, such as above-mentioned encipherment scheme is y=xmIn the embodiment of modn, its corresponding decryption scheme is x=ynmodk.By decryption side
Case is configured in preset configuration file, when interface requests parameter encryption completion, it is necessary to when being submitted to system background, from preset configuration
Its corresponding decryption scheme is obtained in file, this decryption scheme and encrypted interface requests parameter are sent to background system, with
Just background system docks mouth required parameter according to decryption scheme and is decrypted.
In addition, refer to Fig. 4, the present invention provides a kind of interface requests parameter encryption device, joins in interface requests of the present invention
In number encryption device first embodiment, the interface requests parameter encryption device includes:
First acquisition module 10, for when receiving interface requests parameter, obtaining the parameter name of interface requests parameter;
With the development of the communication technology, the application function of types of applications software is more and more, is such as installed on mobile phone or computer
On safety bank, safety easily borrow etc. financing class software, its support function it is stronger and stronger.Each function passes through program code
Realize, in order to facilitate the maintenance of program, API is provided with code, and (Application Programming Interface, should
With Program Interfaces), API is its essence is some pre-defined functions, for application program or application developer
Access the program that this API is set so that application program or application developer need not access the source code of program, or understand in it
Working mechanism of portion is the function of can be achieved or understand code.When realizing some function, there are the transmission of interface requests parameter
Journey, needs log-on message being delivered to background service system when such as logging in safety bank app by login interface, complete on app
Perfect subscriber data can be then delivered in background service system by the operations such as kind subscriber data by the communication interface with backstage
Preserve.The subscriber data that the log-on message or request that this request logs in preserve is interface requests parameter, such interface requests ginseng
Number may relate to the privacy information of user, needs to be encrypted before transmission, was being transmitted to avoid user information
It is compromised in journey.
The interface requests parameter encryption of the present embodiment is used to carry out interface required parameter before background system is delivered to
Encryption.When receiving interface requests parameter, the first acquisition module 10 obtains this corresponding parameter name of interface requests parameter.
Parameter name can characterize the type of interface requests parameter, if interface requests parameter is the age 20, then its parameter entitled age.This is joined
In preset configuration file, preset configuration file is the text configured in advance to the parameter name for needing encryption for several configurations
The parameter name of age type, is such as configured in preset configuration file by part, so that when the parameter name for getting interface requests parameter
For the age when, because of the parameter name in preset configuration file there are this age, then illustrate the interface requests parameter at parameter entitled age
Need to be encrypted.This preset configuration file can use XML format, and it is XML configuration file to make preset configuration file.
Parameter name is configured in xml format in XML configuration file, generates configuration file, XML (eXtensible Markup
Language, extensible markup language) be it is a kind of be used for mark e-file to make it have structural markup language.By parameter
Name is configured to the configuration information in XML configuration file, when the change that parameter name increases or decreases, it is only necessary to this XML
Configuration information in file is increased or decreased accordingly, easy to operate.
First judgment module 20, for judging to whether there is the parameter name in preset configuration file, when preset configuration text
There are during the parameter name in part, encipherment scheme corresponding with parameter name is obtained from preset configuration file;
After the parameter name of interface requests parameter is got, the institute that will be configured in this parameter name and preset configuration file
There is parameter name to compare, to judge to whether there is this parameter name in preset configuration file.Because preset configuration file be used for need into
The parameter name of row encryption is configured, and judges that there are the parameter name of interface requests parameter in preset configuration file so as to work as
When, then interface requests parameter of the explanation with this parameter name needs to be encrypted.The encipherment scheme being wherein encrypted
Corresponding with parameter name in advance to be configured in preset configuration file, i.e., preset configuration file is in advance to needing the parameter of encryption
Name and corresponding encipherment scheme are configured, and the parameter name of age type such as is configured to encipherment scheme A, so that pre- when judging
If there are during parameter name, then certainly exist encipherment scheme corresponding with parameter name in configuration file.First judgment module, 20 basis
Parameter name obtains corresponding encipherment scheme from preset configuration file, with according to encipherment scheme to the interface with parameter name
Required parameter is encrypted.
First encrypting module 30, for according to the encipherment scheme, interface required parameter to be encrypted.
After encipherment scheme corresponding with parameter name is got, the first encrypting module 30 according to this encipherment scheme, to
The interface requests parameter of this parameter name is encrypted.Encrypted concrete mode is determined by encipherment scheme, as encipherment scheme is:Y=
xmModn, wherein y are encrypted ciphertext, and x is the plaintext before encrypting, and m is public key, and n is private key.In order to ensure encrypted
Performance, public key m and private key n can be arranged to be determined by random number k, and random number k can be randomly generated by randomizer,
It can be produced by calculation formula k=p*q, p, q are integer.The present embodiment is said in a manner of obtaining random number by p, q
It is bright, after random number is obtained by p, q, then determine an intermediate quantity L;L is arranged to the least common multiple of (p-1) and (q-1), i.e.,
Intermediate quantity L is determined with this;Public key m is further determined by intermediate quantity L, public key m is set as that with the greatest common divisor of L be 1, i.e.,
M and L is relatively prime to obtain public key m;Private key n is obtained according still further to public key m and intermediate quantity L, its relation is m*n mode L=
1, private key n is thus obtained, so that interface required parameter be encrypted by public key m and private key n.The present embodiment will need to encrypt
Interface requests parameter parameter name and corresponding encipherment scheme be configured in preset configuration file, connect for different types of
Mouth required parameter can configure different encipherment schemes, realizes and passes through different encipherment schemes to different types of interface requests parameter
It is encrypted, the configuration of parameter name and encipherment scheme is simple, the favorable expandability of encipherment scheme.
The interface requests parameter encryption device of the present embodiment, when receiving interface requests parameter, the first acquisition module 10
Obtain the parameter name of interface requests parameter;And there are during this parameter name in preset configuration file, the first judgment module 20 is from pre-
If encipherment scheme corresponding with parameter name is obtained in configuration file;To be asked according to encipherment scheme, the first encrypting module 30 to interface
Parameter is asked to be encrypted.This programme in preset configuration file by configuring the parameter name in need being encrypted and and parameter
The corresponding encipherment scheme of name, when the parameter name of the interface requests parameter received is in this preset configuration file, then shows that this connects
Mouth required parameter needs to encrypt, and encipherment scheme corresponding with parameter name in preset configuration file is obtained, to this interface requests parameter
It is encrypted.Avoid the encipherment scheme by interface requests parameter from being programmed in program code, reduce the coupling of program code,
At the same time because be configured with preset configuration file encrypted interface requests parameter in need correspondence encipherment scheme, it is not necessary to be directed to
Different interface requests parameters write different program codes, improve encrypted flexibility.
Further, Fig. 5 is refer to, on the basis of the interface requests parameter encryption device first embodiment of the present invention, is carried
Go out the second embodiment of interface requests parameter encryption device of the present invention, in a second embodiment, the interface requests parameter encryption
Device further includes:
Second judgment module 40, for judging whether the interface requests parameter that receives is multiple, and multiple interface requests
Whether the parameter name of parameter is consistent;
Understandably, when different user is in a certain application function of same time operation, multiple interface requests can be received
Parameter, and the parameter name of this multiple interface requests parameter may be consistent, such as the age data of m user and n user, both ginsengs
Several is the age.For the identical multiple interface requests parameters of parameter name, it is understood that there may be different encryption requirements, which part
Interface requests parameter needs to encrypt, and another part interface requests parameter need not then encrypt.But for needing encrypted connect
Mouthful required parameter and encrypted interface requests parameter is not required, both parameter names are identical, for phase in preset configuration file
With parameter name encipherment scheme it is identical so that can be not required encrypted interface requests parameter according to its parameter name it is corresponding plus
Operation is encrypted in close scheme.Or in multiple interface requests parameters with identical parameters name, part of interface request is joined
Several encipherment schemes and the encipherment scheme of another part interface requests parameter differ.One of encipherment scheme is complicated, and another
One encipherment scheme is simple.But since both has identical parameter name, and cause both of which to use preset configuration file
In identical encipherment scheme be encrypted.So as to receive interface requests parameter, and obtain the parameter name of interface requests parameter
Afterwards, it is multiple to judge whether this interface requests parameter received has for the second judgment module 40, and this multiple interface requests parameter
Whether parameter name is consistent, with multiple and different interface requests parameters to the different encryption requirements with identical parameters name, carries out area
Divide encryption.
Second acquisition module 50, for when interface requests parameter is multiple, and the parameter of the multiple interface requests parameter
When name is consistent, the identifier entrained by each interface requests parameter is obtained;
This implementation in order to avoid to identical parameters name and the different multiple interface requests parameters of encryption requirements use
Same encipherment scheme is encrypted, and when receiving multiple interface requests parameters, the interface requests of different encryption requirements are joined
Number is provided with identifier, to identify the different encryption requirements of interface requests parameter.Judge that interface requests parameter is more so as to work as
It is a, and multiple interface requests parameters parameter name it is consistent when, the second acquisition module 50 is obtained entrained by each interface requests parameter
Identifier, with the identifier obtained according to this, determine different encryption requirements.
Setup module 60, for the identifier according to each interface requests parameter, to each interface requests parameter setting with
The corresponding parameter alias of its identifier;
After the identifier entrained by each interface requests parameter is obtained, encrypted according to this each interface requests parameter of characterization
The identifier of demand, parameter alias corresponding with its identifier to each interface requests parameter setting.Parameter alias is made an appointment
It is arranged in preset configuration text, for distinguishing the name with identical parameters name but the different interface requests parameter of encipherment scheme
Claim.When receiving that multiple parameters name is identical but during the different interface requests parameter of encryption requirements, setup module 60 is from pre- establishing
Put and parameter alias corresponding with identifier is obtained in file, and this parameter alias is set into corresponding interface requests parameter.
Different parameter alias corresponds to different encipherment schemes, parameter alias and corresponding encipherment scheme equivalent to parameter name and corresponding
The next stage of encipherment scheme.
Second encrypting module 70, for determining corresponding encipherment scheme in preset configuration file according to parameter alias, with root
Interface required parameter is encrypted according to the encipherment scheme.
Further, to each interface requests parameter setting after the corresponding parameter alias of identifier, second encryption mould
Block 70 determines corresponding encipherment scheme in preset configuration file according to this parameter alias, and interface required parameter is encrypted.
In one specific embodiment, the corresponding encipherment scheme of interface requests parameter of the entitled E of parameter is F, when there is three interface requests parameters
Parameter name when being E, the identifier for getting its carrying is respectively s1, s2 and s3, and wherein s1 is encrypted intermediate scheme, at the beginning of s2
Level encipherment scheme, s3, so that according to this identifier and the parameter alias made an appointment, set interface required parameter not encrypt
The parameter alias put is respectively E1, E2 and E3.It is provided with corresponding preset configuration text corresponding with parameter alias E1 and E2
Encipherment scheme F1 and F2, when parameter alias is E1, then obtains F1 from encipherment scheme and interface required parameter are encrypted, when
When parameter alias is E2, then F2 is obtained from encipherment scheme and interface required parameter is encrypted, and when parameter alias is E3,
Because not configured in preset configuration document to this parameter alias, there is no the parameter alias of E3, and critical parameter alias E3
Corresponding interface requests parameter need not encrypt, and operation it is not encrypted.Realize that there are identical parameters by parameter alias
Name but have the encryption of the interface requests parameter of different encryption requirements, can meet different encryption requirements.
With reference to Fig. 6, Fig. 6 is the device structure schematic diagram for the hardware running environment that present invention method is related to.
Interface requests parameter encryption device of the embodiment of the present invention can be PC or smart mobile phone, tablet computer, electricity
The terminal devices such as philosophical works reader, pocket computer.
As shown in fig. 6, the interface requests parameter encryption device can include:Processor 1001, such as CPU, memory
1005, communication bus 1002.Wherein, the connection that communication bus 1002 is used for realization between processor 1001 and memory 1005 is led to
Letter.Memory 1005 can be high-speed RAM memory or the memory (non-volatile memory) of stabilization, example
Such as magnetic disk storage.Memory 1005 optionally can also be the storage device independently of aforementioned processor 1001.
Alternatively, which can also include user interface, network interface, camera, RF
(Radio Frequency, radio frequency) circuit, sensor, voicefrequency circuit, WiFi module etc..User interface can include display
Shield (Display), input unit such as keyboard (Keyboard), optional user interface can also include standard wireline interface,
Wave point.Network interface can optionally include standard wireline interface and wireless interface (such as WI-FI interfaces).
It will be understood by those skilled in the art that interface requests parameter encryption device structure shown in Fig. 6 is not formed pair
The restriction of interface requests parameter encryption device, can include components more more or fewer than diagram, or some components of combination, or
The different component arrangement of person.
As shown in fig. 6, it can lead to as in a kind of memory 1005 of computer-readable storage medium including operating system, network
Believe module and interface requests parameter encipheror.Operating system be management and control interface required parameter encryption device hardware and
The program of software resource, the operation of supporting interface required parameter encipheror and other softwares and/or program.Network service mould
Block is used for realization the communication between each component in the inside of memory 1005, and with other hardware in interface requests parameter encryption device
Communicate between software.
In the interface requests parameter encryption device shown in Fig. 6, processor 1001 is used to perform to store in memory 1005
Interface requests parameter encipheror, realize following steps:
When receiving interface requests parameter, the parameter name of interface requests parameter is obtained;
Judge to whether there is the parameter name in preset configuration file, when there are the parameter name in preset configuration file
When, encipherment scheme corresponding with parameter name is obtained from preset configuration file;
According to the encipherment scheme, interface required parameter is encrypted.
Further, it is described when receiving interface requests parameter, obtain interface requests parameter parameter name the step of it
Afterwards, processor 1001 is used to perform the interface requests parameter encipheror stored in memory 1005, realizes following steps:
Judge the interface requests parameter that receives whether be it is multiple, and the parameter name of multiple interface requests parameters whether one
Cause;
When interface requests parameter is multiple, and the multiple interface requests parameter parameter name it is consistent when, obtain each connects
Identifier entrained by mouth required parameter;
According to the identifier of each interface requests parameter, ginseng corresponding with its identifier to each interface requests parameter setting
Number alias;
Corresponding encipherment scheme in preset configuration file is determined according to parameter alias, with according to the encipherment scheme to interface
Required parameter is encrypted.
Further, after described the step of interface required parameter is encrypted according to the encipherment scheme, processor
1001 are used to perform the interface requests parameter encipheror stored in memory 1005, realize following steps:
Judge whether the encryption of interface requests parameter is completed, when interface requests parameter, which is encrypted, to be completed, by interface requests parameter
Parameter alias delete.
Further, the interface requests parameter of working as is multiple, and the parameter name of the multiple interface requests parameter is consistent
When, the step of obtaining the identifier entrained by each interface requests parameter, includes:
When interface requests parameter is multiple, and the multiple interface requests parameter parameter name it is consistent when, judgement has phase
Whether the encryption requirements of multiple interface requests parameters of same parameter name are consistent;
When the encryption requirements of multiple interface requests parameters with identical parameters name are inconsistent, obtaining please with each interface
Seek the identifier corresponding to the encryption requirements of parameter.
Further, it is described when receiving interface requests parameter, obtain interface requests parameter parameter name the step of it
Before, processor 1001 is used to perform the interface requests parameter encipheror stored in memory 1005, realizes following steps:
Acquisition has the parameter name of encryption requirements and encipherment scheme corresponding with parameter name, and by the encipherment scheme with joining
Several be configured in the lump is pre-seted in file, forms encipherment scheme set.
Further, it is described according to the encipherment scheme, after the step of interface required parameter is encrypted, processor
1001 are used to perform the interface requests parameter encipheror stored in memory 1005, realize following steps:
The encrypted interface requests parameter and corresponding decryption scheme are packaged into data packet and are submitted to default system
System backstage, so that predetermined system backstage obtains resolve packet decryption scheme, predetermined system backstage is according to decryption scheme, docking
Mouth required parameter is decrypted.
Interface requests parameter encryption device embodiment of the present invention and above-mentioned each reality of interface requests parameter encryption method
It is essentially identical to apply example, details are not described herein.
The present invention provides a kind of readable storage medium storing program for executing, the readable storage medium storing program for executing is stored with one or more than one journey
Sequence, the one or more programs can also be performed by one or more than one processor for:
When receiving interface requests parameter, the parameter name of interface requests parameter is obtained;
Judge to whether there is the parameter name in preset configuration file, when there are the parameter name in preset configuration file
When, encipherment scheme corresponding with parameter name is obtained from preset configuration file;
According to the encipherment scheme, interface required parameter is encrypted.
Further, it is described when receiving interface requests parameter, obtain interface requests parameter parameter name the step of it
Afterwards, the one or more programs can also be performed by one or more than one processor for:
Judge the interface requests parameter that receives whether be it is multiple, and the parameter name of multiple interface requests parameters whether one
Cause;
When interface requests parameter is multiple, and the multiple interface requests parameter parameter name it is consistent when, obtain each connects
Identifier entrained by mouth required parameter;
According to the identifier of each interface requests parameter, ginseng corresponding with its identifier to each interface requests parameter setting
Number alias;
Corresponding encipherment scheme in preset configuration file is determined according to parameter alias, with according to the encipherment scheme to interface
Required parameter is encrypted.
Further, after described the step of interface required parameter is encrypted according to the encipherment scheme, described one
A either more than one program can also be performed by one or more than one processor for:
Judge whether the encryption of interface requests parameter is completed, when interface requests parameter, which is encrypted, to be completed, by interface requests parameter
Parameter alias delete.
Further, the interface requests parameter of working as is multiple, and the parameter name of the multiple interface requests parameter is consistent
When, the step of obtaining the identifier entrained by each interface requests parameter, includes:
When interface requests parameter is multiple, and the multiple interface requests parameter parameter name it is consistent when, judgement has phase
Whether the encryption requirements of multiple interface requests parameters of same parameter name are consistent;
When the encryption requirements of multiple interface requests parameters with identical parameters name are inconsistent, obtaining please with each interface
Seek the identifier corresponding to the encryption requirements of parameter.
Further, it is described when receiving interface requests parameter, obtain interface requests parameter parameter name the step of it
Before, the one or more programs can also be performed by one or more than one processor for:
Acquisition has the parameter name of encryption requirements and encipherment scheme corresponding with parameter name, and by the encipherment scheme with joining
Several be configured in the lump is pre-seted in file, forms encipherment scheme set.
Further, it is described according to the encipherment scheme, after the step of interface required parameter is encrypted, described one
A either more than one program can also be performed by one or more than one processor for:
The encrypted interface requests parameter and corresponding decryption scheme are packaged into data packet and are submitted to default system
System backstage, so that predetermined system backstage obtains resolve packet decryption scheme, predetermined system backstage is according to decryption scheme, docking
Mouth required parameter is decrypted.
Readable storage medium storing program for executing embodiment of the present invention and above-mentioned each embodiment of interface requests parameter encryption method are basic
Identical, details are not described herein.
It should also be noted that, herein, term " comprising ", "comprising" or its any other variant are intended to non-
It is exclusive to include, so that process, method, article or device including a series of elements not only include those key elements,
But also including other elements that are not explicitly listed, or further include solid by this process, method, article or device
Some key elements.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including
Also there are other identical element in the process of the key element, method, article or device.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on such understanding, technical scheme substantially in other words does the prior art
Going out the part of contribution can be embodied in the form of software product, which is stored in one as described above
In storage medium (such as ROM/RAM, magnetic disc, CD), including some instructions use so that a station terminal equipment (can be mobile phone,
Computer, server, or network equipment etc.) perform method described in each embodiment of the present invention.
The foregoing is merely the preferred embodiment of the present invention, is not intended to limit the scope of the invention, every at this
Under the design of invention, the equivalent structure transformation made using description of the invention and accompanying drawing content, or directly/it is used in indirectly
His relevant technical field is included in the scope of patent protection of the present invention.
Claims (10)
1. a kind of interface requests parameter encryption method, it is characterised in that the interface requests parameter encryption method includes following step
Suddenly:
When receiving interface requests parameter, the parameter name of interface requests parameter is obtained;
Judge to whether there is the parameter name in preset configuration file, when in preset configuration file there are during the parameter name, from
Encipherment scheme corresponding with parameter name is obtained in preset configuration file;
According to the encipherment scheme, interface required parameter is encrypted.
2. interface requests parameter encryption method as claimed in claim 1, it is characterised in that described to receive interface requests ginseng
Number when, obtain interface requests parameter parameter name the step of after include:
Whether the interface requests parameter for judging to receive is multiple, and whether the parameter name of multiple interface requests parameters is consistent;
When interface requests parameter is multiple, and the multiple interface requests parameter parameter name it is consistent when, obtaining each interface please
Seek the identifier entrained by parameter;
It is other to each interface requests parameter setting parameter corresponding with its identifier according to the identifier of each interface requests parameter
Name;
Corresponding encipherment scheme in preset configuration file is determined according to parameter alias, with according to the encipherment scheme to interface requests
Parameter is encrypted.
3. interface requests parameter encryption method as claimed in claim 2, it is characterised in that described according to the encipherment scheme pair
Include after the step of interface requests parameter is encrypted:
Judge whether the encryption of interface requests parameter is completed, when interface requests parameter, which is encrypted, to be completed, by the ginseng of interface requests parameter
Number alias is deleted.
4. interface requests parameter encryption method as claimed in claim 2, it is characterised in that described when interface requests parameter is more
It is a, and the multiple interface requests parameter parameter name it is consistent when, obtain identifier entrained by each interface requests parameter
Step includes:
When interface requests parameter is multiple, and the multiple interface requests parameter parameter name it is consistent when, judgement has identical ginseng
Whether the encryption requirements of several multiple interface requests parameters are consistent;
When the encryption requirements of multiple interface requests parameters with identical parameters name are inconsistent, obtain with being asked according to each interface
Seek the identifier corresponding to the encryption requirements of parameter.
5. interface requests parameter encryption method as claimed in claim 1, it is characterised in that described to receive interface requests ginseng
Number when, obtain interface requests parameter parameter name the step of before include:
Acquisition has the parameter name of encryption requirements and an encipherment scheme corresponding with parameter name, and by the encipherment scheme and parameter name
It is configured to and is pre-seted in file in the lump, forms encipherment scheme set.
6. such as claim 1-5 any one of them interface requests parameter encryption methods, it is characterised in that add described in the basis
Close scheme, includes after the step of interface required parameter is encrypted:
The encrypted interface requests parameter and corresponding decryption scheme are packaged into after data packet is submitted to predetermined system
Platform, so that predetermined system backstage obtains resolve packet decryption scheme, predetermined system backstage, please to interface according to decryption scheme
Parameter is asked to be decrypted.
7. a kind of interface requests parameter encryption device, it is characterised in that the interface requests parameter encryption device includes:
First acquisition module, for when receiving interface requests parameter, obtaining the parameter name of interface requests parameter;
First judgment module, for judging to whether there is the parameter name in preset configuration file, is deposited when in preset configuration file
In the parameter name, encipherment scheme corresponding with parameter name is obtained from preset configuration file;
First encrypting module, for according to the encipherment scheme, interface required parameter to be encrypted.
8. interface requests parameter encryption device as claimed in claim 7, it is characterised in that the interface requests parameter encryption dress
Put and further include:
Second judgment module, for judging whether the interface requests parameter that receives is multiple, and multiple interface requests parameters
Whether parameter name is consistent;
Second acquisition module, for being multiple when interface requests parameter, and the parameter name of the multiple interface requests parameter is consistent
When, obtain the identifier entrained by each interface requests parameter;
Setup module, for the identifier according to each interface requests parameter, each interface requests parameter setting is identified with it
Accord with corresponding parameter alias;
Second encrypting module, for determining corresponding encipherment scheme in preset configuration file according to parameter alias, with according to
Interface required parameter is encrypted in encipherment scheme.
9. a kind of interface requests parameter encryption device, it is characterised in that the interface requests parameter encryption device includes:Storage
Device, processor, communication bus and the interface requests parameter encipheror being stored on the memory;
The communication bus is used for realization the connection communication between processor and memory;
The processor is used to perform the interface requests parameter encipheror, to realize such as any one of claim 1-6 institutes
The step of interface requests parameter encryption method stated.
10. a kind of readable storage medium storing program for executing, it is characterised in that the computer class is read to be stored with interface requests parameter on storage medium
Encipheror, is realized as any one of claim 1-6 when the interface requests parameter encipheror is executed by processor
Interface requests parameter encryption method the step of.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711234907.4A CN107948170B (en) | 2017-11-30 | 2017-11-30 | Interface request parameter encryption method, device, equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711234907.4A CN107948170B (en) | 2017-11-30 | 2017-11-30 | Interface request parameter encryption method, device, equipment and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107948170A true CN107948170A (en) | 2018-04-20 |
CN107948170B CN107948170B (en) | 2020-11-24 |
Family
ID=61947908
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711234907.4A Active CN107948170B (en) | 2017-11-30 | 2017-11-30 | Interface request parameter encryption method, device, equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107948170B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108616537A (en) * | 2018-04-28 | 2018-10-02 | 湖南麒麟信安科技有限公司 | A kind of conventional data encryption and decryption method and system of lower coupling |
CN109255246A (en) * | 2018-08-14 | 2019-01-22 | 平安普惠企业管理有限公司 | Interface parameters encryption method, device, computer equipment and storage medium |
CN109274656A (en) * | 2018-09-04 | 2019-01-25 | 平安普惠企业管理有限公司 | Interface parameters decryption method, device, computer equipment and storage medium |
CN109828908A (en) * | 2018-12-15 | 2019-05-31 | 中国平安人寿保险股份有限公司 | Interface testing parameter encryption method, device, electronic equipment and storage medium |
CN112632590A (en) * | 2021-01-04 | 2021-04-09 | 深圳市亿联无限科技有限公司 | Automatic encryption and decryption method and device for database parameters of embedded terminal equipment |
CN113254951A (en) * | 2021-04-23 | 2021-08-13 | 天津车之家数据信息技术有限公司 | Data processing method and computing device |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101145904A (en) * | 2007-11-07 | 2008-03-19 | 杭州华三通信技术有限公司 | A method, device and system for data packet transmission |
CN102833794A (en) * | 2012-08-02 | 2012-12-19 | 广州市花都区中山大学国光电子与通信研究院 | Method for configuring wireless network settings of thin client device using intelligent terminal |
CN102880825A (en) * | 2012-08-28 | 2013-01-16 | 无锡华御信息技术有限公司 | Method and system for efficiently calling hardware encryption equipment in UNIX/LINUX environment |
CN106357643A (en) * | 2016-09-20 | 2017-01-25 | 福建新和兴信息技术有限公司 | System and method for recognition of cloud platform data calling applications |
US20170078254A1 (en) * | 2011-12-16 | 2017-03-16 | Maxlinear, Inc. | Method And Apparatus For Providing Conditional Access Based On Channel Characteristics |
CN107122297A (en) * | 2017-04-18 | 2017-09-01 | 上海雷腾软件股份有限公司 | The method and apparatus that request message for test interface is generated |
CN107332821A (en) * | 2017-05-27 | 2017-11-07 | 北京奇虎科技有限公司 | It is a kind of to realize the method communicated between client and server, device and server |
-
2017
- 2017-11-30 CN CN201711234907.4A patent/CN107948170B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101145904A (en) * | 2007-11-07 | 2008-03-19 | 杭州华三通信技术有限公司 | A method, device and system for data packet transmission |
US20170078254A1 (en) * | 2011-12-16 | 2017-03-16 | Maxlinear, Inc. | Method And Apparatus For Providing Conditional Access Based On Channel Characteristics |
CN102833794A (en) * | 2012-08-02 | 2012-12-19 | 广州市花都区中山大学国光电子与通信研究院 | Method for configuring wireless network settings of thin client device using intelligent terminal |
CN102880825A (en) * | 2012-08-28 | 2013-01-16 | 无锡华御信息技术有限公司 | Method and system for efficiently calling hardware encryption equipment in UNIX/LINUX environment |
CN106357643A (en) * | 2016-09-20 | 2017-01-25 | 福建新和兴信息技术有限公司 | System and method for recognition of cloud platform data calling applications |
CN107122297A (en) * | 2017-04-18 | 2017-09-01 | 上海雷腾软件股份有限公司 | The method and apparatus that request message for test interface is generated |
CN107332821A (en) * | 2017-05-27 | 2017-11-07 | 北京奇虎科技有限公司 | It is a kind of to realize the method communicated between client and server, device and server |
Non-Patent Citations (1)
Title |
---|
DZ45693: "如何写出安全的API接口?接口参数加密签名设计思路,https://blog.csdn.net/ma_jiang/article/details/53636840", 《CSDN》 * |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108616537A (en) * | 2018-04-28 | 2018-10-02 | 湖南麒麟信安科技有限公司 | A kind of conventional data encryption and decryption method and system of lower coupling |
CN108616537B (en) * | 2018-04-28 | 2021-11-30 | 湖南麒麟信安科技股份有限公司 | Low-coupling general data encryption and decryption method and system |
CN109255246A (en) * | 2018-08-14 | 2019-01-22 | 平安普惠企业管理有限公司 | Interface parameters encryption method, device, computer equipment and storage medium |
CN109274656A (en) * | 2018-09-04 | 2019-01-25 | 平安普惠企业管理有限公司 | Interface parameters decryption method, device, computer equipment and storage medium |
CN109274656B (en) * | 2018-09-04 | 2022-04-22 | 平安普惠企业管理有限公司 | Interface parameter decryption method and device, computer equipment and storage medium |
CN109828908A (en) * | 2018-12-15 | 2019-05-31 | 中国平安人寿保险股份有限公司 | Interface testing parameter encryption method, device, electronic equipment and storage medium |
CN112632590A (en) * | 2021-01-04 | 2021-04-09 | 深圳市亿联无限科技有限公司 | Automatic encryption and decryption method and device for database parameters of embedded terminal equipment |
CN113254951A (en) * | 2021-04-23 | 2021-08-13 | 天津车之家数据信息技术有限公司 | Data processing method and computing device |
CN113254951B (en) * | 2021-04-23 | 2022-07-19 | 天津车之家数据信息技术有限公司 | Data processing method and computing device |
Also Published As
Publication number | Publication date |
---|---|
CN107948170B (en) | 2020-11-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107948170A (en) | Interface requests parameter encryption method, device, equipment and readable storage medium storing program for executing | |
JP6332766B2 (en) | Trusted Service Manager Trusted Security Zone Container for data protection and confidentiality | |
US20090298468A1 (en) | System and method for deleting data in a communication device | |
EP2698756A1 (en) | Local Trusted Service Manager | |
EP3041189A1 (en) | Communication control apparatus, authentication device, central control apparatus and communication systems | |
EP2405376B1 (en) | Utilization of a microcode interpreter built in to a processor | |
EP3511853B1 (en) | Security authentication method, integrated circuit and system | |
EP1881663B1 (en) | Management of multiple connections to a security token access device | |
CN104935435A (en) | Login methods, terminal and application server | |
CN105975867A (en) | Data processing method | |
US20100243736A1 (en) | Storage device management systems and methods | |
CN107852603A (en) | The method and apparatus of terminal authentication | |
KR20140048094A (en) | Method for programming a mobile terminal chip | |
EP2689367B1 (en) | Data protection using distributed security key | |
CN101808317B (en) | Computer device and method for realizing wireless local area network security measure | |
CN110636491A (en) | Service-oriented trusted execution module and communication method | |
CN104270342B (en) | The access method and system of virtual desktop | |
CN111386513B (en) | Data processing method, device and system chip | |
CN106537962A (en) | Method, device, and equipment for wireless network configuration, access, and visit | |
CN106453335B (en) | Data transmission method and device | |
EP2591437B1 (en) | Microcode-based challenge/response process | |
US20180107840A1 (en) | Method of restoring a secure element to a factory state | |
KR20040082362A (en) | Authentication information management method using mobile terminal and user authentication method | |
CN105635096A (en) | Data module access method, system and terminal | |
CN113439292B (en) | System and method for managing trusted applications in computer chip modules |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |