The Spark database electronic password lock of a kind of safe and convenient use and working method thereof
Technical field
The present invention relates to computer network security field, particularly relate to Spark database electronic password lock and the working method thereof of a kind of safe and convenient use.
Background technology
Along with the develop rapidly of internet, mobile Internet and thing networking, the data volume of generation is increasing, and the value analysis of these mass data produced is more and more important, and the various demands for the analysis of mass data get more and more.
In prior art, for a large amount of data processing, Spark becomes main data processing platform (DPP), and application is more and more, and user also to be tried to achieve more and more higher for the security of database. particularly for the content in database, user does not wish to allow unrelated personnel know. therefore, Spark database development business arranges the mechanism of user name and password for user establishes, that is, it may also be useful to the personnel of Spark database must first start user name and the password that Spark application program sets up oneself, and this user name and password are stored in Spark database. after, enter Spark database, as long as in the process starting Spark database, with the user name of oneself and password login Spark database, user name in user name when logging in and password and Spark database and password will be compared by the startup program of Spark database, if user name when logging in is identical with the user name in Spark database, simultaneously, password during login is identical with the password in Spark database, then Spark database is just opened, otherwise, Spark database can not be opened, to play the effect to the data security secrecy in Spark database. but, all to be inputted user name when user starts Spark database and password just can open database every time, be often database of not opening because of a certain character input mistake, bring great worry to user. for this reason, Spark database development business is also for user provides the mechanism storing user name and password in computer. as depicted in figs. 1 and 2, the user name of oneself and password can be kept in the configuration file of Spark application program by user, like this, when starting Spark database, user name in user name in configuration file and password and Spark database and password are directly compared by startup program, if Spark database is just opened in comparison success, otherwise, Spark database can not be opened. owing to such password is not through transposition encryption, but directly be recorded in configuration file, therefore, when unrelated personnel are once the user name obtained in configuration file and password, just can start Spark database on other computer gently and at one stroke, user name and password login by finding in configuration file open Spark database, steal the significant data in Spark database. like this, the Spark database of safe and convenient use cannot be realized.
Summary of the invention
The technical problem that the present invention to be solved there is provided the Spark database electronic password lock of a kind of safe and convenient use, user name and this password are arranged in configuration file, can conveniently open Spark database, even if got user name and this password by unrelated person, also cannot start Spark database on other computer gently and at one stroke, user name and this password login by finding in configuration file open Spark database, steal the significant data in Spark database, therefore, this password safe and convenient can open Spark database.
Another technical problem that the present invention to be solved is to provide the working method of the Spark database electronic password lock of a kind of safe and convenient use, the password obtained by the method is arranged in configuration file, can conveniently open Spark database, even if got user name and this password by unrelated person, also cannot start Spark database on other computer gently and at one stroke, user name and this password login by finding in configuration file open Spark database, steal the significant data in Spark database, therefore, this password safe and convenient can open Spark database.
With regard to product, in order to solve an above-mentioned technical problem, the present invention provides the Spark database electronic password lock of safe and convenient use, user name and password are arranged in Spark database, and be arranged in the configuration file of Spark application program, the password being arranged in the configuration file of Spark application program is by being obtained through transposition encryption by the password being arranged in Spark database.
Described transposition encryption is the transposition encryption that capital and small letter English alphabet changes mutually, or, the transposition encryption of English alphabet and digital addition and subtraction displacement number, or, the transposition encryption that the ASCII coding of English alphabet and numeral is transformed to base64 coding, or, the combination of above-mentioned two kinds of transposition encryptions, or, the combination of above-mentioned two or more transposition encryption.
The transposition encryption that described capital and small letter English alphabet changes mutually is after the password of reading Spark database, small English alphabet is turned into capitalization English letter, capitalization English letter is turned into small English alphabet;
The transposition encryption of described English alphabet and digital addition and subtraction displacement number be the figure place obtaining password as displacement number, password is done displacement, if password figure place is even number, does addition displacement, if password figure place is odd number, do subtraction displacement;
Described addition displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value-65+ displacement number)/26;
Lowercase conversion formula: 97+ (letter ASCII value-97+ displacement number)/26;
Numeral conversion formula: 48+ (numeral ASCII value-48+ displacement number)/10;
Described subtraction displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value+26-displacement number-65)/26;
Lowercase conversion formula: 97+ (letter ASCII value+26-displacement number-97)/26;
Numeral conversion formula: 48+ (numeral ASCII value+10-displacement number-48)/10;
The described transposition encryption that the ASCII coding of English alphabet and numeral is transformed to base64 coding is first from left to right arranged in order by the eight-digit binary number ASCII code of each character in Spark database password, again with the grouping of every 6 from left to right or from the right side to a left side, two 0 are mended afterwards before every 6, form the form of 8 bytes, draw corresponding character according to base64 coding schedule; If remaining character is less than 3 eight-digit binary number bytes, then fill thereafter with 0, output character use '='.
Described base64 coding schedule is standard base64 coding schedule, or, described base64 coding schedule is from meaning of word base64 coding schedule;
Described standard base64 coding schedule be successively by A-Z, a-z, 0-9 ,+,/sequence, and encode by 0-63;
Described self-defined base64 coding schedule be successively will+,/, A-Z, a-z, 0-9 sequence, and encode by 0-63; Or,
Described self-defined base64 coding schedule be successively by Z-A, a-z, 0-9 ,+,/sequence, and encode by 0-63; Or,
Described standard base64 coding schedule be first by A-Z, a-z, 0-9 ,+, after/sequence upsets order, then sort, then, encode by 0-63.
The Spark database electronic password lock of the safe and convenient use of the present invention compared with prior art has following useful effect.
1, the technical program due to the password that have employed in the configuration file being arranged on Spark application program be the technique means by the password being arranged in Spark database is obtained through transposition encryption, so, can conveniently open Spark database, even if got user name and this password by unrelated person, also cannot start Spark database on other computer gently and at one stroke, user name and this password login by finding in configuration file open Spark database, steal the significant data in Spark database, therefore, this password safe and convenient can open Spark database.
2, the technical program is the transposition encryption that capital and small letter English alphabet changes mutually owing to have employed described transposition encryption, or, the transposition encryption of English alphabet and digital addition and subtraction displacement number, or, the ASCII coding of English alphabet and numeral is transformed to the transposition encryption of base64 coding, or, the combination of above-mentioned two kinds of transposition encryptions, or, the technique means of the combination of above-mentioned two or more transposition encryption, so, it is possible to adopt the mode of multiple encryption that Spark database password is carried out transposition encryption, considerably increase the difficulty of decryption.
3, the transposition encryption that the technical program changes mutually owing to have employed described capital and small letter English alphabet is after the password of reading Spark database, small English alphabet is turned into capitalization English letter, capitalization English letter is turned into small English alphabet;
The transposition encryption of described English alphabet and digital addition and subtraction displacement number be the figure place obtaining password as displacement number, password is done displacement, if password figure place is even number, does addition displacement, if password figure place is odd number, do subtraction displacement;
Described addition displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value-65+ displacement number)/26;
Lowercase conversion formula: 97+ (letter ASCII value-97+ displacement number)/26;
Numeral conversion formula: 48+ (numeral ASCII value-48+ displacement number)/10;
Described subtraction displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value+26-displacement number-65)/26;
Lowercase conversion formula: 97+ (letter ASCII value+26-displacement number-97)/26;
Numeral conversion formula: 48+ (numeral ASCII value+10-displacement number-48)/10;
The described transposition encryption that the ASCII coding of English alphabet and numeral is transformed to base64 coding is first from left to right arranged in order by the eight-digit binary number ASCII code of each character in Spark database password, again with the grouping of every 6 from left to right or from the right side to a left side, two 0 are mended afterwards before every 6, form the form of 8 bytes, draw corresponding character according to base64 coding schedule; If remaining character is less than 3 eight-digit binary number bytes, then fill thereafter with 0, output character use '='. Technique means, so, further increase again the difficulty of decryption.
4, the technical program is standard base64 coding schedule owing to have employed described base64 coding schedule, or, described base64 coding schedule is from meaning of word base64 coding schedule;
Described standard base64 coding schedule be successively by A-Z, a-z, 0-9 ,+,/sequence, and encode by 0-63;
Described self-defined base64 coding schedule be successively will+,/, A-Z, a-z, 0-9 sequence, and encode by 0-63; Or,
Described self-defined base64 coding schedule be successively by Z-A, a-z, 0-9 ,+,/sequence, and encode by 0-63; Or,
Described standard base64 coding schedule be first by A-Z, a-z, 0-9 ,+, after/sequence upsets order, then sort, then, carry out the technique means encoded by 0-63, so, further add the difficulty of decryption.
With regard to method, in order to solve another technical problem above-mentioned, the present invention provides the working method of the Spark database electronic password lock of a kind of safe and convenient use, first user name and password are arranged in Spark database, again user name and described password are arranged in the configuration file of Spark application program, before user name and described password are arranged in the configuration file of Spark application program, first by encipheror, the password being arranged in Spark database is obtained through the step of transposition encryption the password of encryption, afterwards, again the password of user name and encryption is arranged in the configuration file of Spark application program, when starting Spark database, startup program first reads in the configuration file of Spark application program the password encrypted, call decrypted program again to the password to decipher of encryption, then, password after user name and deciphering and user name and password in Spark database are compared, if the user name in configuration file is identical with the user name in Spark database, simultaneously, password after deciphering is identical with the password in Spark database, then Spark database is just opened, otherwise, Spark database can not be opened.
The step of described transposition encryption is the step of the transposition encryption that capital and small letter English alphabet changes mutually, or, the step of the transposition encryption of English alphabet and digital addition and subtraction displacement number, or, the step that the ASCII coding of English alphabet and numeral is transformed to the transposition encryption of base64 coding, or, the combination of above-mentioned two kinds of transposition encryption steps, or, the combination of above-mentioned two or more transposition encryption step.
The step of the transposition encryption that described capital and small letter English alphabet changes mutually first reads the password of Spark database, then, small English alphabet is turned into capitalization English letter, capitalization English letter is turned into small English alphabet;
The step of the transposition encryption of described English alphabet and digital addition and subtraction displacement number be first using obtain password figure place as displacement number, then password is done displacement, if password figure place is even number, does addition displacement, if password figure place is odd number, do subtraction displacement;
Described addition displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value-65+ displacement number)/26;
Lowercase conversion formula: 97+ (letter ASCII value-97+ displacement number)/26;
Numeral conversion formula: 48+ (numeral ASCII value-48+ displacement number)/10;
Described subtraction displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value+26-displacement number-65)/26;
Lowercase conversion formula: 97+ (letter ASCII value+26-displacement number-97)/26;
Numeral conversion formula: 48+ (numeral ASCII value+10-displacement number-48)/10;
The step of the described transposition encryption that the ASCII coding of English alphabet and numeral is transformed to base64 coding is first from left to right arranged in order by the eight-digit binary number ASCII code of each character in Spark database password, again with the grouping of every 6 from left to right or from the right side to a left side, two 0 are mended afterwards before every 6, form the form of 8 bytes, draw corresponding character according to base64 coding schedule; If remaining character is less than 3 eight-digit binary number bytes, then fill thereafter with 0, output character use '='.
Described base64 coding schedule is standard base64 coding schedule, or, described base64 coding schedule is from meaning of word base64 coding schedule;
Described standard base64 coding schedule be successively by A-Z, a-z, 0-9 ,+,/sequence, and encode by 0-63;
Described self-defined base64 coding schedule be successively will+,/, A-Z, a-z, 0-9 sequence, and encode by 0-63; Or,
Described self-defined base64 coding schedule be successively by Z-A, a-z, 0-9 ,+,/sequence, and encode by 0-63; Or,
Described standard base64 coding schedule be first by A-Z, a-z, 0-9 ,+, after/sequence upsets order, then sort, then, encode by 0-63.
The startup program of described encipheror and described decrypted program and described Spark database is compiled into one after integrating can execute file, or, the startup program of described encipheror, described decrypted program, described Spark database compiles respectively, and the startup program of described Spark database can call described encipheror and described decrypted program respectively.
Described base64 coding schedule is arranged in the startup program of Spark database, or, described base64 coding schedule is separately positioned in described encipheror and described decrypted program, or, described base64 coding schedule independently is kept on removable equipment.
The working method of the Spark database electronic password lock of the safe and convenient use of the present invention compared with prior art has following useful effect.
1, the technical program is owing to have employed before being arranged in the configuration file of Spark application program by user name and described password, first by encipheror, the password being arranged in Spark database is obtained through the step of transposition encryption the password of encryption, afterwards, then the password of user name and encryption is arranged in the configuration file of Spark application program, when starting Spark database, startup program first reads in the configuration file of Spark application program the password encrypted, call decrypted program again to the password to decipher of encryption, then, password after user name and deciphering and user name and password in Spark database are compared, if the user name in configuration file is identical with the user name in Spark database, simultaneously, password after deciphering is identical with the password in Spark database, then Spark database is just opened, otherwise, the technique means that Spark database can not be opened, so, the password obtained by the method is arranged in configuration file, can conveniently open Spark database, even if got user name and this password by unrelated person, also cannot start Spark database on other computer gently and at one stroke, user name and this password login by finding in configuration file open Spark database, steal the significant data in Spark database, therefore, this password safe and convenient can open Spark database.
2, the technical program is owing to have employed the step that the step of described transposition encryption is the transposition encryption that capital and small letter English alphabet changes mutually, or, the step of the transposition encryption of English alphabet and digital addition and subtraction displacement number, or, the ASCII coding of English alphabet and numeral is transformed to the step of the transposition encryption of base64 coding, or, the combination of above-mentioned two kinds of transposition encryption steps, or, the technique means of the combination of above-mentioned two or more transposition encryption step, so, can adopt the mode of multiple encryption that Spark database password is carried out transposition encryption, considerably increase the difficulty of decryption.
3, the technical program is first read the password of Spark database owing to have employed the step of the transposition encryption that described capital and small letter English alphabet changes mutually, then, small English alphabet is turned into capitalization English letter, capitalization English letter is turned into small English alphabet;
The step of the transposition encryption of described English alphabet and digital addition and subtraction displacement number be first using obtain password figure place as displacement number, then password is done displacement, if password figure place is even number, does addition displacement, if password figure place is odd number, do subtraction displacement;
Described addition displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value-65+ displacement number)/26;
Lowercase conversion formula: 97+ (letter ASCII value-97+ displacement number)/26;
Numeral conversion formula: 48+ (numeral ASCII value-48+ displacement number)/10;
Described subtraction displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value+26-displacement number-65)/26;
Lowercase conversion formula: 97+ (letter ASCII value+26-displacement number-97)/26;
Numeral conversion formula: 48+ (numeral ASCII value+10-displacement number-48)/10;
The step of the described transposition encryption that the ASCII coding of English alphabet and numeral is transformed to base64 coding is first from left to right arranged in order by the eight-digit binary number ASCII code of each character in Spark database password, again with the grouping of every 6 from left to right or from the right side to a left side, two 0 are mended afterwards before every 6, form the form of 8 bytes, draw corresponding character according to base64 coding schedule; If remaining character is less than 3 eight-digit binary number bytes, then fill thereafter with 0, the technique means of output character use '=', so, further increase again the difficulty of decryption.
4, the technical program is standard base64 coding schedule owing to have employed described base64 coding schedule, or, described base64 coding schedule is from meaning of word base64 coding schedule;
Described standard base64 coding schedule be successively by A-Z, a-z, 0-9 ,+,/sequence, and encode by 0-63;
Described self-defined base64 coding schedule be successively will+,/, A-Z, a-z, 0-9 sequence, and encode by 0-63; Or,
Described self-defined base64 coding schedule be successively by Z-A, a-z, 0-9 ,+,/sequence, and encode by 0-63; Or,
Described standard base64 coding schedule be first by A-Z, a-z, 0-9 ,+, after/sequence upsets order, then sort, then, carry out the technique means encoded by 0-63, so, further add the difficulty of decryption.
5, the technical program can execute file owing to being compiled into one after have employed the startup program of described encipheror and described decrypted program and described Spark database and integrating, or, the startup program of described encipheror, described decrypted program, described Spark database compiles respectively, the startup program of described Spark database can call the technique means of described encipheror and described decrypted program respectively, can bring more difficulty to decryption.
6, the technical program is arranged in the startup program of Spark database owing to have employed described base64 coding schedule, or, described base64 coding schedule is separately positioned in described encipheror and described decrypted program, or, the technique means that described base64 coding schedule independently is kept on removable equipment, so, decryption is almost impossible.
Accompanying drawing explanation
Fig. 1 is the schema arranging user name and password in prior art.
Fig. 2 is the schema opening Spark database in prior art.
Fig. 3 is the schema that the present invention arranges user name and password.
Fig. 4 is the schema that the present invention opens Spark database.
Fig. 5 is standard base64 coded representation intention.
Embodiment
As shown in Figure 3 and Figure 4, present embodiments provide for the Spark database electronic password lock of safe and convenient use, user name and password are arranged in Spark database, and be arranged in the configuration file of Spark application program, the password being arranged in the configuration file of Spark application program is by being obtained through transposition encryption by the password being arranged in Spark database.
Present embodiment due to the password that have employed in the configuration file being arranged on Spark application program be the technique means by the password being arranged in Spark database is obtained through transposition encryption, so, can conveniently open Spark database, even if got user name and this password by unrelated person, also cannot start Spark database on other computer gently and at one stroke, user name and this password login by finding in configuration file open Spark database, steal the significant data in Spark database, therefore, this password safe and convenient can open Spark database.
The first step as present embodiment is improved, as shown in Figure 3 and Figure 4, described transposition encryption is the transposition encryption that capital and small letter English alphabet changes mutually, or, the transposition encryption of English alphabet and digital addition and subtraction displacement number, or, the transposition encryption that the ASCII coding of English alphabet and numeral is transformed to base64 coding, or, the combination of above-mentioned two kinds of transposition encryptions, or, the combination of above-mentioned two or more transposition encryption.
Present embodiment is the transposition encryption that capital and small letter English alphabet changes mutually owing to have employed described transposition encryption, or, the transposition encryption of English alphabet and digital addition and subtraction displacement number, or, the ASCII coding of English alphabet and numeral is transformed to the transposition encryption of base64 coding, or, the combination of above-mentioned two kinds of transposition encryptions, or, the technique means of the combination of above-mentioned two or more transposition encryption, so, it is possible to adopt the mode of multiple encryption that Spark database password is carried out transposition encryption, considerably increase the difficulty of decryption.
The 2nd step as present embodiment is improved, as shown in Figure 3 and Figure 4, the transposition encryption that described capital and small letter English alphabet changes mutually is after the password of reading Spark database, small English alphabet is turned into capitalization English letter, capitalization English letter is turned into small English alphabet; As: A is transformed to a, and b is transformed to B.
The transposition encryption of described English alphabet and digital addition and subtraction displacement number be the figure place obtaining password as displacement number, password is done displacement, if password figure place is even number, does addition displacement, if password figure place is odd number, do subtraction displacement;
Described addition displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value-65+ displacement number)/26;
Lowercase conversion formula: 97+ (letter ASCII value-97+ displacement number)/26;
Numeral conversion formula: 48+ (numeral ASCII value-48+ displacement number)/10;
Such as, when password is abcd1234, password figure place is 8, and after dividing exactly remainder, English alphabet and numeral all want displacement 8, it may also be useful to English alphabet and numeral are done conversion process by conversion formula above respectively, and after conversion, password turns into: ijkl9012.
Described subtraction displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value+26-displacement number-65)/26;
Lowercase conversion formula: 97+ (letter ASCII value+26-displacement number-97)/26;
Numeral conversion formula: 48+ (numeral ASCII value+10-displacement number-48)/10;
The described transposition encryption that the ASCII coding of English alphabet and numeral is transformed to base64 coding is first from left to right arranged in order by the eight-digit binary number ASCII code of each character in Spark database password, again with the grouping of every 6 from left to right or from the right side to a left side, two 0 are mended afterwards before every 6, form the form of 8 bytes, draw corresponding character according to base64 coding schedule; If remaining character is less than 3 eight-digit binary number bytes, then fill thereafter with 0, output character use '='.
The transposition encryption that present embodiment changes mutually owing to have employed described capital and small letter English alphabet is after the password of reading Spark database, small English alphabet is turned into capitalization English letter, capitalization English letter is turned into small English alphabet;
The transposition encryption of described English alphabet and digital addition and subtraction displacement number be the figure place obtaining password as displacement number, password is done displacement, if password figure place is even number, does addition displacement, if password figure place is odd number, do subtraction displacement;
Described addition displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value-65+ displacement number)/26;
Lowercase conversion formula: 97+ (letter ASCII value-97+ displacement number)/26;
Numeral conversion formula: 48+ (numeral ASCII value-48+ displacement number)/10;
Described subtraction displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value+26-displacement number-65)/26;
Lowercase conversion formula: 97+ (letter ASCII value+26-displacement number-97)/26;
Numeral conversion formula: 48+ (numeral ASCII value+10-displacement number-48)/10;
The described transposition encryption that the ASCII coding of English alphabet and numeral is transformed to base64 coding is first from left to right arranged in order by the eight-digit binary number ASCII code of each character in Spark database password, again with the grouping of every 6 from left to right or from the right side to a left side, two 0 are mended afterwards before every 6, form the form of 8 bytes, draw corresponding character according to base64 coding schedule; If remaining character is less than 3 eight-digit binary number bytes, then fill thereafter with 0, output character use '='. Technique means, so, further increase again the difficulty of decryption.
The 3rd step as present embodiment is improved, and as shown in Figure 5, described base64 coding schedule is standard base64 coding schedule, or, described base64 coding schedule is from meaning of word base64 coding schedule;
Described standard base64 coding schedule be successively by A-Z, a-z, 0-9 ,+,/sequence, and encode by 0-63;
Described self-defined base64 coding schedule be successively will+,/, A-Z, a-z, 0-9 sequence, and encode by 0-63; Similar self-defined base64 coding schedule can be a variety of.
Can also be, described self-defined base64 coding schedule be successively by Z-A, a-z, 0-9 ,+,/sequence, and encode by 0-63; Similar self-defined base64 coding schedule can be a variety of.
Can also be, described standard base64 coding schedule be first by A-Z, a-z, 0-9 ,+, after/sequence upsets order, then sort, then, encode by 0-63; Similar self-defined base64 coding schedule almost has countless versions.
Present embodiment is standard base64 coding schedule owing to have employed described base64 coding schedule, or, described base64 coding schedule is from meaning of word base64 coding schedule;
Described standard base64 coding schedule be successively by A-Z, a-z, 0-9 ,+,/sequence, and encode by 0-63;
Described self-defined base64 coding schedule be successively will+,/, A-Z, a-z, 0-9 sequence, and encode by 0-63; Or,
Described self-defined base64 coding schedule be successively by Z-A, a-z, 0-9 ,+,/sequence, and encode by 0-63; Or,
Described standard base64 coding schedule be first by A-Z, a-z, 0-9 ,+, after/sequence upsets order, then sort, then, carry out the technique means encoded by 0-63, so, further add the difficulty of decryption.
As shown in Figure 3 and Figure 4, the present invention provides the working method of the Spark database electronic password lock of a kind of safe and convenient use, first user name and password are arranged in Spark database, again user name and described password are arranged in the configuration file of Spark application program, before user name and described password are arranged in the configuration file of Spark application program, first by encipheror, the password being arranged in Spark database is obtained through the step of transposition encryption the password of encryption, afterwards, again the password of user name and encryption is arranged in the configuration file of Spark application program, when starting Spark database, startup program first reads in the configuration file of Spark application program the password encrypted, call decrypted program again to the password to decipher of encryption, then, password after user name and deciphering and user name and password in Spark database are compared, if the user name in configuration file is identical with the user name in Spark database, simultaneously, password after deciphering is identical with the password in Spark database, then Spark database is just opened, otherwise, Spark database can not be opened.
Present embodiment is owing to have employed before being arranged in the configuration file of Spark application program by user name and described password, first by encipheror, the password being arranged in Spark database is obtained through the step of transposition encryption the password of encryption, afterwards, then the password of user name and encryption is arranged in the configuration file of Spark application program, when starting Spark database, startup program first reads in the configuration file of Spark application program the password encrypted, call decrypted program again to the password to decipher of encryption, then, password after user name and deciphering and user name and password in Spark database are compared, if the user name in configuration file is identical with the user name in Spark database, simultaneously, password after deciphering is identical with the password in Spark database, then Spark database is just opened, otherwise, the technique means that Spark database can not be opened, so, the password obtained by the method is arranged in configuration file, can conveniently open Spark database, even if got user name and this password by unrelated person, also cannot start Spark database on other computer gently and at one stroke, user name and this password login by finding in configuration file open Spark database, steal the significant data in Spark database, therefore, this password safe and convenient can open Spark database.
The first step as present embodiment is improved, as shown in Figure 3 and Figure 4, the step of described transposition encryption is the step of the transposition encryption that capital and small letter English alphabet changes mutually, or, the step of the transposition encryption of English alphabet and digital addition and subtraction displacement number, or, the step that the ASCII coding of English alphabet and numeral is transformed to the transposition encryption of base64 coding, or, the combination of above-mentioned two kinds of transposition encryption steps, or, the combination of above-mentioned two or more transposition encryption step.
Present embodiment is owing to have employed the step that the step of described transposition encryption is the transposition encryption that capital and small letter English alphabet changes mutually, or, the step of the transposition encryption of English alphabet and digital addition and subtraction displacement number, or, the ASCII coding of English alphabet and numeral is transformed to the step of the transposition encryption of base64 coding, or, the combination of above-mentioned two kinds of transposition encryption steps, or, the technique means of the combination of above-mentioned two or more transposition encryption step, so, can adopt the mode of multiple encryption that Spark database password is carried out transposition encryption, considerably increase the difficulty of decryption.
The 2nd step as present embodiment is improved, as shown in Figure 3 and Figure 4, the step of the transposition encryption that described capital and small letter English alphabet changes mutually first reads the password of Spark database, then, small English alphabet is turned into capitalization English letter, capitalization English letter is turned into small English alphabet;
The step of the transposition encryption of described English alphabet and digital addition and subtraction displacement number be first using obtain password figure place as displacement number, then password is done displacement, if password figure place is even number, does addition displacement, if password figure place is odd number, do subtraction displacement;
Described addition displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value-65+ displacement number)/26;
Lowercase conversion formula: 97+ (letter ASCII value-97+ displacement number)/26;
Numeral conversion formula: 48+ (numeral ASCII value-48+ displacement number)/10;
Described subtraction displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value+26-displacement number-65)/26;
Lowercase conversion formula: 97+ (letter ASCII value+26-displacement number-97)/26;
Numeral conversion formula: 48+ (numeral ASCII value+10-displacement number-48)/10;
The step of the described transposition encryption that the ASCII coding of English alphabet and numeral is transformed to base64 coding is first from left to right arranged in order by the eight-digit binary number ASCII code of each character in Spark database password, again with the grouping of every 6 from left to right or from the right side to a left side, two 0 are mended afterwards before every 6, form the form of 8 bytes, draw corresponding character according to base64 coding schedule; If remaining character is less than 3 eight-digit binary number bytes, then fill thereafter with 0, output character use '='.
Present embodiment is first read the password of Spark database owing to have employed the step of the transposition encryption that described capital and small letter English alphabet changes mutually, then, small English alphabet is turned into capitalization English letter, capitalization English letter is turned into small English alphabet;
The step of the transposition encryption of described English alphabet and digital addition and subtraction displacement number be first using obtain password figure place as displacement number, then password is done displacement, if password figure place is even number, does addition displacement, if password figure place is odd number, do subtraction displacement;
Described addition displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value-65+ displacement number)/26;
Lowercase conversion formula: 97+ (letter ASCII value-97+ displacement number)/26;
Numeral conversion formula: 48+ (numeral ASCII value-48+ displacement number)/10;
Described subtraction displacement conversion formula is:
Capitalization conversion formula: 65+ (letter ASCII value+26-displacement number-65)/26;
Lowercase conversion formula: 97+ (letter ASCII value+26-displacement number-97)/26;
Numeral conversion formula: 48+ (numeral ASCII value+10-displacement number-48)/10;
The step of the described transposition encryption that the ASCII coding of English alphabet and numeral is transformed to base64 coding is first from left to right arranged in order by the eight-digit binary number ASCII code of each character in Spark database password, again with the grouping of every 6 from left to right or from the right side to a left side, two 0 are mended afterwards before every 6, form the form of 8 bytes, draw corresponding character according to base64 coding schedule; If remaining character is less than 3 eight-digit binary number bytes, then fill thereafter with 0, the technique means of output character use '=', so, further increase again the difficulty of decryption.
The 3rd step as present embodiment is improved, and as shown in Figure 5, described base64 coding schedule is standard base64 coding schedule, or, described base64 coding schedule is from meaning of word base64 coding schedule;
Described standard base64 coding schedule be successively by A-Z, a-z, 0-9 ,+,/sequence, and encode by 0-63;
Described self-defined base64 coding schedule be successively will+,/, A-Z, a-z, 0-9 sequence, and encode by 0-63; Or,
Described self-defined base64 coding schedule be successively by Z-A, a-z, 0-9 ,+,/sequence, and encode by 0-63; Or,
Described standard base64 coding schedule be first by A-Z, a-z, 0-9 ,+, after/sequence upsets order, then sort, then, encode by 0-63.
Present embodiment is standard base64 coding schedule owing to have employed described base64 coding schedule, or, described base64 coding schedule is from meaning of word base64 coding schedule;
Described standard base64 coding schedule be successively by A-Z, a-z, 0-9 ,+,/sequence, and encode by 0-63;
Described self-defined base64 coding schedule be successively will+,/, A-Z, a-z, 0-9 sequence, and encode by 0-63; Or,
Described self-defined base64 coding schedule be successively by Z-A, a-z, 0-9 ,+,/sequence, and encode by 0-63; Or,
Described standard base64 coding schedule be first by A-Z, a-z, 0-9 ,+, after/sequence upsets order, then sort, then, carry out the technique means encoded by 0-63, so, further add the difficulty of decryption.
The 4th step as present embodiment is improved, the startup program of described encipheror and described decrypted program and described Spark database is compiled into one after integrating can execute file, or, the startup program of described encipheror, described decrypted program, described Spark database compiles respectively, and the startup program of described Spark database can call described encipheror and described decrypted program respectively.
Present embodiment can execute file owing to being compiled into one after have employed the startup program of described encipheror and described decrypted program and described Spark database and integrating, or, the startup program of described encipheror, described decrypted program, described Spark database compiles respectively, the startup program of described Spark database can call the technique means of described encipheror and described decrypted program respectively, can bring more difficulty to decryption.
The 5th step as present embodiment is improved, described base64 coding schedule is arranged in the startup program of Spark database, or, described base64 coding schedule is separately positioned in described encipheror and described decrypted program, or, described base64 coding schedule independently is kept on removable equipment.
Present embodiment is arranged in the startup program of Spark database owing to have employed described base64 coding schedule, or, described base64 coding schedule is separately positioned in described encipheror and described decrypted program, or, the technique means that described base64 coding schedule independently is kept on removable equipment, so, decryption is almost impossible.
It should be noted that, above with reference to described by accompanying drawing each embodiment only in order to the present invention to be described but not limit the scope of the invention, it will be understood by those within the art that, amendment the present invention carried out under the premise without departing from the spirit and scope of the present invention or equivalent replacement, all should contain within the scope of the present invention. In addition, outside being referred to unless the context, the word occurred in the singular comprises plural form, and vice versa. In addition, unless stated otherwise, all or part of of so any embodiment can use in conjunction with all or part of of other embodiment any.