WO2017107530A1 - 一种spark数据库电子密码锁及其操作方法 - Google Patents

一种spark数据库电子密码锁及其操作方法 Download PDF

Info

Publication number
WO2017107530A1
WO2017107530A1 PCT/CN2016/096758 CN2016096758W WO2017107530A1 WO 2017107530 A1 WO2017107530 A1 WO 2017107530A1 CN 2016096758 W CN2016096758 W CN 2016096758W WO 2017107530 A1 WO2017107530 A1 WO 2017107530A1
Authority
WO
WIPO (PCT)
Prior art keywords
spark
password
database
displacement
encoding table
Prior art date
Application number
PCT/CN2016/096758
Other languages
English (en)
French (fr)
Inventor
孙刚
冯骏
Original Assignee
深圳市华讯方舟软件技术有限公司
华讯方舟科技有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 深圳市华讯方舟软件技术有限公司, 华讯方舟科技有限公司 filed Critical 深圳市华讯方舟软件技术有限公司
Publication of WO2017107530A1 publication Critical patent/WO2017107530A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Definitions

  • the invention relates to the field of computer network security, in particular to a Spark database electronic code lock which is safe and convenient to use and an operation method thereof.
  • Spark has become a major data processing platform, and applications are more and more, and users are required to have higher and higher security for databases.
  • the user does not want to let the unrelated people know. Therefore, the Spark database developer has established a mechanism for setting the user name and password for the user. That is to say, the person using the Spark database must first start the Spark application to establish his own username and password, which is stored in the Spark database. . In the future, to enter the Spark database, as long as you start the Spark database, log in to the Spark database with your own username and password.
  • the Spark database startup program compares the username and password at login with the username and password in the Spark database.
  • the Spark database is opened. Otherwise, the Spark database cannot be opened.
  • the user name and password must be entered to open the database. It is often because of a character input error that the database cannot be opened, which brings great trouble to the user.
  • Spark database developers also provide users with a mechanism to store user names and passwords in the computer. As shown in Figure 1 and Figure 2, the user can save his or her username and password in the Spark application configuration file.
  • the startup program directly uses the username and password in the configuration file and the Spark database. The username and password are compared.
  • the Spark database is opened. Otherwise, the Spark database cannot be opened. Since such a password is not converted and encrypted, but is directly recorded in the configuration file, when an unrelated person gets the username and password in the configuration file, the Spark database can be started on other computers with ease. Log in to the Spark database by using the username and password found in the configuration file to steal important data from the Spark database. This way, it is impossible to achieve both Safe and easy to use Spark database.
  • One technical problem to be solved by the present invention is to provide a Spark database electronic password lock that is safe and convenient to use.
  • the user name and the password are set in the configuration file, and the Spark database can be conveniently opened even if the user is obtained by an unrelated person.
  • Name and the password can not easily start the Spark database on other computers, log in to the Spark database by logging in the username and password found in the configuration file, stealing important data in the Spark database, so the password can be safe and Easy to open the Spark database.
  • Another technical problem to be solved by the present invention is to provide a method for operating an electronic password lock of a Spark database that is safe and convenient to use.
  • the password obtained by the method is set in a configuration file, and the Spark database can be conveniently opened even if it is irrelevant.
  • the person obtains the user name and the password, and can not easily start the Spark database on other computers.
  • the user name and the password found in the configuration file are used to log in to open the Spark database and steal important data in the Spark database. Therefore, the password is used. It is safe and convenient to open the Spark database.
  • the present invention provides a secure and convenient use of the Spark database electronic password lock, the user name and password are set in the Spark database, and are set in the Spark application configuration file, set in The password in the Spark application's configuration file is obtained by transforming and encrypting the password set in the Spark database.
  • the transform encryption is a transform encryption in which uppercase and lowercase English letters are mutually changed, or transform encryption of English letters and numbers plus or minus displacement numbers, or transforming ASCII codes of English letters and numbers into base64 encoded transform encryption, or A combination of two transform encryptions, or a combination of two or more transform encryptions described above.
  • the conversion encryption of the uppercase and lowercase English letters is to change the password of the Spark database, and then convert the lowercase English letters into uppercase English letters, and the uppercase English letters into lowercase English letters;
  • the conversion encryption of the English letter and number addition and subtraction displacement number is to obtain the number of digits of the password as the displacement number, and to shift the password. If the number of digits of the password is an even number, the addition displacement is performed, and if the number of digits of the password is an odd number, the subtraction displacement is performed. ;
  • the subtraction displacement transformation formula is:
  • the base64 encoding table is a standard base64 encoding table, or the base64 encoding table is a self-meaning base64 encoding table;
  • the standard base64 coding table sequentially sorts A-Z, a-z, 0-9, +, /, and encodes according to 0-63;
  • the custom base64 encoding table sequentially sorts +, /, A-Z, a-z, 0-9, and encodes according to 0-63; or
  • the custom base64 encoding table sequentially sorts Z-A, a-z, 0-9, +, /, and encodes according to 0-63; or
  • the standard base64 encoding table first sorts the A-Z, a-z, 0-9, +, / sorts, then sorts them, and then encodes them according to 0-63.
  • the Spark database electronic code lock which is safe and convenient to use, has the following beneficial effects compared with the prior art.
  • the technical solution adopts the technical method that the password set in the Spark application is converted and encrypted by the password set in the Spark database, so that the Spark database can be conveniently opened even if it is not an unrelated person. Obtain the user name and the password, and you can not start the Spark database on other computers in a simple way. Log in to the Spark database by using the username and password found in the configuration file to steal important data in the Spark database. Therefore, the password can be It is safe and convenient to open the Spark database.
  • the technical solution adopts the transform encryption to convert and encrypt the uppercase and lowercase English letters, or to convert and encrypt the letters and numbers of the letters and numbers, or to convert the ASCII codes of English letters and numbers into base64.
  • the technical solution adopts the transformation of the uppercase and lowercase English letters to each other. After encrypting the password of the Spark database, the encryption converts the lowercase English letters into uppercase English letters and the uppercase English letters into lowercase English letters.
  • the conversion encryption of the English letter and number addition and subtraction displacement number is to obtain the number of digits of the password as the displacement number, and to shift the password. If the number of digits of the password is an even number, the addition displacement is performed, and if the number of digits of the password is an odd number, the subtraction displacement is performed. ;
  • the subtraction displacement transformation formula is:
  • the technical means therefore, further increases the difficulty of cracking the password.
  • the technical solution adopts the base64 encoding table as a standard base64 encoding table, or the base64 encoding table is a self-meaning base64 encoding table;
  • the standard base64 coding table sequentially sorts A-Z, a-z, 0-9, +, /, and encodes according to 0-63;
  • the custom base64 encoding table sequentially sorts +, /, A-Z, a-z, 0-9, and encodes according to 0-63; or
  • the custom base64 encoding table sequentially sorts Z-A, a-z, 0-9, +, /, and encodes according to 0-63; or
  • the standard base64 encoding table is a technical means for first sorting the AZ, az, 0-9, +, / sorts, then sorting, and then encoding according to 0-63, so the crack password is further increased. Difficulty.
  • the present invention provides an operation method of the Spark database electronic password lock which is safe and convenient to use, first setting the user name and password in the Spark database, and then the user name and the location.
  • the password is set in the configuration file of the Spark application.
  • the encryption program will be set in the Spark data.
  • the password in the library is encrypted and encrypted to obtain the encrypted password.
  • the user name and the encrypted password are set in the configuration file of the Spark application.
  • the startup program first reads out the configuration file of the Spark application.
  • the encrypted password is then decrypted by the decryption program to decrypt the encrypted password.
  • the username and the decrypted password are compared with the username and password in the Spark database. If the username in the configuration file is the same as the username in the Spark database. At the same time, the decrypted password is the same as the password in the Spark database, then the Spark database is opened. Otherwise, the Spark database cannot be opened.
  • the step of transforming and encrypting is a step of transforming and encrypting uppercase and lowercase English letters, or a step of transforming and encrypting English letters and numbers plus or minus displacement numbers, or converting ASCII codes of English letters and numbers into base64 coded
  • the step of transforming and encrypting the uppercase and lowercase English letters is to first read the password of the Spark database, and then change the lowercase English letters into uppercase English letters, and the uppercase English letters into lowercase English letters;
  • the step of transforming and encrypting the letter and number of the English alphabet and the number of digits is first to obtain the number of bits of the password as the number of bits, and then to shift the password. If the number of bits of the code is even, the addition is performed, if the number of bits is odd. Then do the subtraction displacement;
  • the subtraction displacement transformation formula is:
  • the step of converting the ASCII code of English letters and numbers into base64 coded transform encryption is to first arrange the eight-bit binary ASCII codes of each character in the Spark database password from left to right, and then from left to right or from right to The left is grouped by 6 bits, then 2 bits are added in front of every 6 bits to form an 8-bit one-byte form.
  • the base64 encoding table is a standard base64 encoding table, or the base64 encoding table is a self-meaning base64 encoding table;
  • the standard base64 encoding table sequentially sorts A-Z, a-z, 0-9, +, /, and Encoded by 0-63;
  • the custom base64 encoding table sequentially sorts +, /, A-Z, a-z, 0-9, and encodes according to 0-63; or
  • the custom base64 encoding table sequentially sorts Z-A, a-z, 0-9, +, /, and encodes according to 0-63; or
  • the standard base64 encoding table first sorts the A-Z, a-z, 0-9, +, / sorts, then sorts them, and then encodes them according to 0-63.
  • the encryption program and the decryption program are integrated with the startup program of the Spark database and compiled into an executable file, or the encryption program, the decryption program, and the startup program of the Spark database are respectively compiled.
  • the startup program of the Spark database may separately invoke the encryption program and the decryption program.
  • the base64 encoding table is set in a startup program of the Spark database, or the base64 encoding table is respectively set in the encryption program and the decryption program, or the base64 encoding table is independently saved on the mobile device. .
  • the method for operating the electronic code lock of the Spark database which is safe and convenient to use has the following beneficial effects compared with the prior art.
  • the technical solution adopts the steps of setting the user name and the password in the configuration file of the Spark application, and then encrypting and encrypting the password set in the Spark database through the encryption program, and then obtaining the encrypted password. Then set the username and the encrypted password in the configuration file of the Spark application; when the Spark database is started, the startup program first reads the encrypted password in the configuration file of the Spark application, and then calls the decryption program to decrypt the encrypted password, and then, Compare the username and the decrypted password with the username and password in the Spark database. If the username in the configuration file is the same as the username in the Spark database, and the decrypted password is the same as the password in the Spark database, The Spark database is opened. Otherwise, the Spark database cannot be opened.
  • the password obtained by this method is set in the configuration file, so that the Spark database can be easily opened even if the user name and the password are obtained by the unrelated person. Can't start Spark data on other computers in one fell swoop
  • the library opens the Spark database by logging in with the username and password found in the configuration file to steal important data from the Spark database. Therefore, the password can be used to open the Spark database safely and conveniently.
  • the step of using the transform encryption is a step of transforming and encrypting the uppercase and lowercase letters of the English alphabet, or a step of transforming and encrypting the alphanumeric characters plus or minus the displacement number, or, the English alphabet and the number
  • the ASCII encoding is converted into a base64 encoded transform encryption step, or a combination of the above two transform encryption steps, or a combination of the above two or more transform encryption steps, so
  • the Spark database password is transformed and encrypted by using multiple encryption methods, which greatly increases the difficulty of cracking the password.
  • the technical solution adopts the conversion encryption method in which the uppercase and lowercase English letters are mutually changed.
  • the step of reading the Spark database password is first, then the lowercase English letters are changed to uppercase English letters, and the uppercase English letters are changed to lowercase English. letter;
  • the step of transforming and encrypting the letter and number of the English alphabet and the number of digits is first to obtain the number of bits of the password as the number of bits, and then to shift the password. If the number of bits of the code is even, the addition is performed, if the number of bits is odd. Then do the subtraction displacement;
  • the subtraction displacement transformation formula is:
  • the step of converting the ASCII code of English letters and numbers into base64 coded transform encryption is to first arrange the eight-bit binary ASCII codes of each character in the Spark database password from left to right, and then from left to right or from right to The left is grouped by 6 bits, then 2 bits are added in front of every 6 bits to form an 8-bit one-byte form.
  • the technical solution adopts the base64 encoding table as a standard base64 encoding table, or the base64 encoding table is a self-meaning base64 encoding table;
  • the standard base64 coding table sequentially sorts A-Z, a-z, 0-9, +, /, and encodes according to 0-63;
  • the custom base64 encoding table sequentially sorts +, /, A-Z, a-z, 0-9, and encodes according to 0-63; or
  • the custom base64 encoding table sequentially sorts Z-A, a-z, 0-9, +, /, and encodes according to 0-63; or
  • the standard base64 encoding table is a technical means for first sorting the AZ, az, 0-9, +, / sorts, then sorting, and then encoding according to 0-63, so the crack password is further increased. Difficulty.
  • the technical solution is compiled into an executable file by using the encryption program and the decryption program integrated with the startup program of the Spark database, or
  • the encryption program, the decryption program, and the startup program of the Spark database are separately compiled, and the startup program of the Spark database may respectively invoke the encryption program and the technical means of the decryption program, which may bring the cracked password. More difficulties.
  • the technical solution is set in the startup program of the Spark database by using the base64 encoding table, or the base64 encoding table is respectively set in the encryption program and the decryption program, or the base64 encoding table.
  • 1 is a flow chart of setting a username and password in the prior art.
  • FIG. 2 is a flow chart of opening a Spark database in the prior art.
  • FIG. 3 is a flow chart of setting up a username and password in accordance with the present invention.
  • FIG. 4 is a flow chart of the present invention opening a Spark database.
  • Figure 5 is a schematic diagram of a standard base64 encoding table.
  • the present embodiment provides a secure and convenient Spark database electronic password lock.
  • the user name and password are set in the Spark database, and are set in the Spark application configuration file, and are set in the Spark application.
  • the password in the configuration file of the program is obtained by transforming and encrypting the password set in the Spark database.
  • the Spark database can be conveniently opened even if it is obtained by an unrelated person.
  • the user name and the password cannot be used to start the Spark database on other computers.
  • the user name and password found in the configuration file are used to log in to open the Spark database and steal important data in the Spark database. Therefore, the password can be secure. It is also convenient to open the Spark database.
  • the transform encryption is a transform encryption in which uppercase and lowercase English letters are mutually changed, or a transform encryption of an English letter and a number of addition and subtraction displacement numbers, or The ASCII code of the English alphabet and number is converted into a base64 coded transform encryption, or a combination of the above two types of transform encryption, or a combination of the above two types of transform encryption.
  • the transform encryption is used to convert the uppercase and lowercase English letters to each other, or to convert and encrypt the English letters and numbers, or to convert the ASCII codes of English letters and numbers into base64 codes.
  • the transform encryption of the uppercase and lowercase English letters is to change the password of the Spark database, and then convert the lowercase English letters into uppercase English letters.
  • Uppercase English letters become lowercase English letters; for example, A transforms to a, and b transforms to B.
  • the conversion encryption of the English letter and number addition and subtraction displacement number is to obtain the number of digits of the password as the displacement number, and to shift the password. If the number of digits of the password is an even number, the addition displacement is performed, and if the number of digits of the password is an odd number, the subtraction displacement is performed. ;
  • the number of digits of the password is 8 digits.
  • the English letters and numbers must be shifted by 8 digits.
  • the above transformation formula is used to transform the English letters and numbers, and the converted password becomes: ijkl9012.
  • the subtraction displacement transformation formula is:
  • the conversion encryption of the English letter and number addition and subtraction displacement number is to obtain the number of digits of the password as the displacement number, and to shift the password. If the number of digits of the password is an even number, the addition displacement is performed, and if the number of digits of the password is an odd number, the subtraction displacement is performed. ;
  • the subtraction displacement transformation formula is:
  • the technical means therefore, further increases the difficulty of cracking the password.
  • the base64 encoding table is a standard base64 encoding table, or the base64 encoding table is a self-meaning base64 encoding table;
  • the standard base64 coding table sequentially sorts A-Z, a-z, 0-9, +, /, and encodes according to 0-63;
  • the custom base64 encoding table sequentially sorts +, /, A-Z, a-z, 0-9, and encodes according to 0-63; similar custom base64 encoding tables can be various.
  • custom base64 encoding table sequentially sorts Z-A, a-z, 0-9, +, /, and encodes 0-63; similar custom base64 encoding tables can be various.
  • the standard base64 encoding table first sorts the AZ, az, 0-9, +, / sorts, then sorts them, and then encodes them according to 0-63; similar custom base64 encoding tables There are almost countless kinds.
  • the base64 encoding table is a standard base64 encoding table, or the base64 encoding table is a self-defined base64 encoding table.
  • the standard base64 coding table sequentially sorts A-Z, a-z, 0-9, +, /, and encodes according to 0-63;
  • the custom base64 encoding table sequentially sorts +, /, A-Z, a-z, 0-9, and encodes according to 0-63; or
  • the custom base64 encoding table sequentially sorts Z-A, a-z, 0-9, +, /, and encodes according to 0-63; or
  • the standard base64 encoding table is a technical means for first sorting the AZ, az, 0-9, +, / sorts, then sorting, and then encoding according to 0-63, so the crack password is further increased. Difficulty.
  • the present invention provides a method for operating an electronic password lock of a Spark database that is safe and convenient to use.
  • the user name and password are first set in the Spark database, and the user name and the password are set in the In the configuration file of the Spark application, before the user name and the password are set in the configuration file of the Spark application, the password set in the Spark database is encrypted and encrypted by the encryption program, and then the encrypted password is obtained.
  • the startup program first reads the encrypted password in the configuration file of the Spark application, and then calls the decryption program to decrypt the encrypted password, and then, Compare the username and the decrypted password with the username and password in the Spark database. If the username in the configuration file is the same as the username in the Spark database, and the decrypted password is the same as the password in the Spark database, The Spark database is opened. Otherwise, the Spark database cannot be opened.
  • the password set in the Spark database is encrypted and encrypted by the encryption program, and then the encrypted password is obtained.
  • the user name and the encrypted password are set in the configuration file of the Spark application; when the Spark database is started, the startup program first reads the encrypted password in the configuration file of the Spark application, and then calls the decryption program to decrypt the encrypted password, and then, the user is The name and the decrypted password are compared with the username and password in the Spark database. If the username in the configuration file is the same as the username in the Spark database, and the decrypted password is the same as the password in the Spark database, the Spark database is used.
  • the Spark database can not be opened by the technical means, so the password obtained by this method is set in the configuration file, and the Spark database can be conveniently opened, even if the unnamed person obtains the user name and the password, it cannot be light. And start the Spark database on other computers in one fell swoop.
  • the password can be both safe and convenient to open the Spark database.
  • the step of transforming and encrypting is a step of transforming and encrypting upper and lower English letters, or a transformation of English letters and numbers plus or minus displacement numbers.
  • the step of using the transform encryption is a step of transforming and encrypting the uppercase and lowercase letters of the English alphabet, or a step of transforming and encrypting the alphanumeric characters plus or minus the number of shifts, or an ASCII of English letters and numbers.
  • Encoding to base64 The step of encoding the transform encryption, or the combination of the above two transform encryption steps, or the combination of the above two or more transform encryption steps, so that the Spark database password can be transformed and encrypted by using multiple encryption methods. It greatly increases the difficulty of cracking passwords.
  • the step of transforming and encrypting the uppercase and lowercase letters of the English alphabet is to first read the password of the Spark database, and then change the lowercase English alphabet to uppercase. English letters, the uppercase English letters are changed to lowercase English letters;
  • the step of transforming and encrypting the letter and number of the English alphabet and the number of digits is first to obtain the number of bits of the password as the number of bits, and then to shift the password. If the number of bits of the code is even, the addition is performed, if the number of bits is odd. Then do the subtraction displacement;
  • the subtraction displacement transformation formula is:
  • the step of converting the ASCII code of English letters and numbers into base64 coded transform encryption is to first arrange the eight-bit binary ASCII codes of each character in the Spark database password from left to right, and then from left to right or from right to The left is grouped by 6 bits, then 2 bits are added in front of every 6 bits to form an 8-bit one-byte form.
  • the step of transforming and encrypting the uppercase and lowercase English letters is to first read the password of the Spark database, and then change the lowercase English letters to uppercase English letters, and the uppercase English letters to lowercase English letters;
  • the step of transforming and encrypting the letter and number of the English alphabet and the number of digits is first to obtain the number of bits of the password as the number of bits, and then to shift the password. If the number of bits of the code is even, the addition is performed, if the number of bits is odd. Then do the subtraction displacement;
  • the subtraction displacement transformation formula is:
  • the step of converting the ASCII code of English letters and numbers into base64 coded transform encryption is to first arrange the eight-bit binary ASCII codes of each character in the Spark database password from left to right, and then from left to right or from right to The left is grouped by 6 bits, then 2 bits are added in front of every 6 bits to form an 8-bit one-byte form.
  • the base64 encoding table is a standard base64 encoding table, or the base64 encoding table is a self-meaning base64 encoding table;
  • the standard base64 coding table sequentially sorts A-Z, a-z, 0-9, +, /, and encodes according to 0-63;
  • the custom base64 encoding table sequentially sorts +, /, A-Z, a-z, 0-9, and encodes according to 0-63; or
  • the custom base64 encoding table sequentially sorts Z-A, a-z, 0-9, +, /, and encodes according to 0-63; or
  • the standard base64 encoding table first sorts the A-Z, a-z, 0-9, +, / sorts, then sorts them, and then encodes them according to 0-63.
  • the base64 encoding table is a standard base64 encoding table, or the base64 encoding table is a self-defined base64 encoding table.
  • the standard base64 coding table sequentially sorts A-Z, a-z, 0-9, +, /, and encodes according to 0-63;
  • the custom base64 encoding table sequentially sorts +, /, A-Z, a-z, 0-9, and encodes according to 0-63; or
  • the custom base64 encoding table sequentially sorts Z-A, a-z, 0-9, +, /, and encodes according to 0-63; or
  • the standard base64 encoding table is a technical means for first sorting the AZ, az, 0-9, +, / sorts, then sorting, and then encoding according to 0-63, so the crack password is further increased. Difficulty.
  • the encryption program and the decryption program are integrated with the startup program of the Spark database, and then compiled into an executable file, or the encryption program, the decryption program,
  • the startup program of the Spark database is separately compiled, and the startup program of the Spark database can respectively invoke the addition a secret program and the decryption program.
  • the encryption program and the decryption program are integrated with the startup program of the Spark database, and then compiled into an executable file, or the encryption program, the decryption program, and the Spark database.
  • the startup program is separately compiled, and the startup program of the Spark database can respectively invoke the encryption program and the technical means of the decryption program, which can bring more difficulties to crack the password.
  • the base64 encoding table is set in an startup program of the Spark database, or the base64 encoding table is respectively set in the encryption program and the decryption program, or the base64
  • the code table is stored independently on the removable device.
  • the base64 encoding table is set in the startup program of the Spark database, or the base64 encoding table is respectively set in the encryption program and the decryption program, or the base64 encoding table is independently.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Storage Device Security (AREA)

Abstract

提供了一种Spark数据库电子密码锁和操作方法,先将用户名和密码设置在Spark数据库中,将设置在Spark数据库中的密码经过变换加密得到加密的密码,之后,再将用户名和加密的密码设置在Spark应用程序的配置文件中;启动Spark数据库时,启动程序先读出Spark应用程序的配置文件中加密的密码,再对加密的密码解密,然后,将用户名和解密后的密码与Spark数据库中的用户名和密码相比对,如果比对成功,则Spark数据库才被打开,否则,Spark数据库不能被打开。用该方法得到的密码设置在配置文件中,可以方便地打开Spark数据库,即使被无关人员获取到用户名和该密码,也无法轻而易举地在其它电脑上启动Spark数据库,因此,该密码可以既安全又方便打开Spark数据库。

Description

[根据细则37.2由ISA制定的发明名称] 一种SPARK数据库电子密码锁及其操作方法 技术领域
本发明涉及计算机网络安全领域,尤其涉及一种既安全又方便使用的Spark数据库电子密码锁及其操作方法。
背景技术
随着互联网、移动互联网和物联网的飞速发展,产生的数据量越来越大,对这些大量数据的分析而产生的价值越来越重要,对于大量数据的分析的各种需求越来越多。
现有技术中,对于大量的数据处理,Spark成为主要的数据处理平台,应用越来越多,用户对于数据库的安全性也要求得越来越高。特别是对于数据库中的内容,用户不希望让无关的人员知晓。因此,Spark数据库开发商为用户建立了设置用户名和密码的机制,也就是说,使用Spark数据库的人员必须先启动Spark应用程序建立自己的用户名和密码,该用户名和密码是存储在Spark数据库中的。以后,要进入Spark数据库,只要在启动Spark数据库的过程中,以自己的用户名和密码登录Spark数据库,Spark数据库的启动程序就会将登录时的用户名和密码与Spark数据库中的用户名和密码相比对,如果登录时的用户名与Spark数据库中的用户名相同,同时,登录时的密码与Spark数据库中的密码相同,则Spark数据库才被打开,否则,Spark数据库不能被打开,以起到对Spark数据库中的数据安全保密的作用。但是,用户每次启动Spark数据库时都要输入用户名和密码才能打开数据库,经常是因某一个字符输入错误而打不开数据库,给用户带来极大的烦恼。为此,Spark数据库开发商还为用户提供了在电脑中存储用户名和密码的机制。如图1和图2所示,用户可以将自己的用户名和密码保存在Spark应用程序的配置文件中,这样,当启动Spark数据库时,启动程序直接将配置文件中的用户名和密码与Spark数据库中的用户名和密码相比对,如果比对成功就打开Spark数据库,否则,不能打开Spark数据库。由于这样的密码没有经过变换加密,而是直接地记录在配置文件中,因此,当无关的人员一旦得到配置文件中的用户名和密码时,就可以轻而一举地在其它电脑上启动Spark数据库,通过在配置文件中找到的用户名和密码登录打开Spark数据库,窃取Spark数据库中的重要数据。这样,无法实现既 安全又方便使用的Spark数据库。
发明内容
本发明要解决的一个技术问题是提供了一种既安全又方便使用的Spark数据库电子密码锁,将用户名和该密码设置在配置文件中,可以方便地打开Spark数据库,即使被无关人员获取到用户名和该密码,也无法轻而一举地在其它电脑上启动Spark数据库,通过在配置文件中找到的用户名和该密码登录打开Spark数据库,窃取Spark数据库中的重要数据,因此,该密码可以既安全又方便打开Spark数据库。
本发明要解决的另一个技术问题是提供一种既安全又方便使用的Spark数据库电子密码锁的操作方法,用该方法得到的密码设置在配置文件中,可以方便地打开Spark数据库,即使被无关人员获取到用户名和该密码,也无法轻而一举地在其它电脑上启动Spark数据库,通过在配置文件中找到的用户名和该密码登录打开Spark数据库,窃取Spark数据库中的重要数据,因此,该密码可以既安全又方便打开Spark数据库。
就产品而言,为了解决上述一个技术问题,本发明提供了既安全又方便使用的Spark数据库电子密码锁,用户名和密码设置在Spark数据库中,并设置在Spark应用程序的配置文件中,设置在Spark应用程序的配置文件中的密码是通过将设置在Spark数据库中的密码经过变换加密得到的。
所述变换加密是大小写英文字母相互变化的变换加密,或者,英文字母和数字加减位移数的变换加密,或者,将英文字母和数字的ASCII编码变换为base64编码的变换加密,或者,上述两种变换加密的组合,或者,上述两种以上变换加密的组合。
所述大小写英文字母相互变化的变换加密是读取Spark数据库的密码后,将小写英文字母变为大写英文字母,将大写英文字母变为小写英文字母;
所述英文字母和数字加减位移数的变换加密是以获取密码的位数作为位移数,对密码做位移,如果密码位数为偶数则做加法位移,如果密码位数为奇数则做减法位移;
所述加法位移变换公式为:
大写字母变换公式:65+(字母ASCII值-65+位移数)/26;
小写字母变换公式:97+(字母ASCII值-97+位移数)/26;
数字变换公式:48+(数字ASCII值-48+位移数)/10;
所述减法位移变换公式为:
大写字母变换公式:65+(字母ASCII值+26-位移数-65)/26;
小写字母变换公式:97+(字母ASCII值+26-位移数-97)/26;
数字变换公式:48+(数字ASCII值+10-位移数-48)/10;
所述将英文字母和数字的ASCII编码变换为base64编码的变换加密是先将Spark数据库密码中各个字符的八位二进制ASCII码从左到右依次排列,再从左到右或从右到左以每6位的分组,之后在每6位的前面补两个0,形成8位一个字节的形式,按照base64编码表得出相应的字符;如果剩下的字符不足3个八位二进制字节,则用0在其后填充,输出字符使用′=′。
所述base64编码表是标准base64编码表,或者,所述base64编码表是自字义base64编码表;
所述标准base64编码表是依次将A-Z、a-z、0-9、+、/排序,并按0-63进行编码;
所述自定义base64编码表是依次将+、/、A-Z、a-z、0-9排序,并按0-63进行编码;或者,
所述自定义base64编码表是依次将Z-A、a-z、0-9、+、/排序,并按0-63进行编码;或者,
所述标准base64编码表是先将A-Z、a-z、0-9、+、/排序打乱顺序后,再进行排序,然后,按0-63进行编码。
本发明既安全又方便使用的Spark数据库电子密码锁与现有技术相比具有以下有益效果。
1、本技术方案由于采用了设置在Spark应用程序的配置文件中的密码是通过将设置在Spark数据库中的密码经过变换加密得到的技术手段,所以,可以方便地打开Spark数据库,即使被无关人员获取到用户名和该密码,也无法轻而一举地在其它电脑上启动Spark数据库,通过在配置文件中找到的用户名和该密码登录打开Spark数据库,窃取Spark数据库中的重要数据,因此,该密码可以既安全又方便打开Spark数据库。
2、本技术方案由于采用了所述变换加密是大小写英文字母相互变化的变换加密,或者,英文字母和数字加减位移数的变换加密,或者,将英文字母和数字的ASCII编码变换为base64编码的变换加密,或者,上述两种变换加密的组合,或者,上述两种以上变换加密的组合的技术手段,所以,可以采用多种加密的方式对Spark数据库密码进行变换加密,大大增加了破解密码的难度。
3、本技术方案由于采用了所述大小写英文字母相互变化的变换 加密是读取Spark数据库的密码后,将小写英文字母变为大写英文字母,将大写英文字母变为小写英文字母;
所述英文字母和数字加减位移数的变换加密是以获取密码的位数作为位移数,对密码做位移,如果密码位数为偶数则做加法位移,如果密码位数为奇数则做减法位移;
所述加法位移变换公式为:
大写字母变换公式:65+(字母ASCII值-65+位移数)/26;
小写字母变换公式:97+(字母ASCII值-97+位移数)/26;
数字变换公式:48+(数字ASCII值-48+位移数)/10;
所述减法位移变换公式为:
大写字母变换公式:65+(字母ASCII值+26-位移数-65)/26;
小写字母变换公式:97+(字母ASCII值+26-位移数-97)/26;
数字变换公式:48+(数字ASCII值+10-位移数-48)/10;
所述将英文字母和数字的ASCII编码变换为base64编码的变换加密是先将Spark数据库密码中各个字符的八位二进制ASCII码从左到右依次排列,再从左到右或从右到左以每6位的分组,之后在每6位的前面补两个0,形成8位一个字节的形式,按照base64编码表得出相应的字符;如果剩下的字符不足3个八位二进制字节,则用0在其后填充,输出字符使用′=′。的技术手段,所以,又进一步增大了破解密码的难度。
4、本技术方案由于采用了所述base64编码表是标准base64编码表,或者,所述base64编码表是自字义base64编码表;
所述标准base64编码表是依次将A-Z、a-z、0-9、+、/排序,并按0-63进行编码;
所述自定义base64编码表是依次将+、/、A-Z、a-z、0-9排序,并按0-63进行编码;或者,
所述自定义base64编码表是依次将Z-A、a-z、0-9、+、/排序,并按0-63进行编码;或者,
所述标准base64编码表是先将A-Z、a-z、0-9、+、/排序打乱顺序后,再进行排序,然后,按0-63进行编码的技术手段,所以,更进一步增加了破解密码的难度。
就方法而言,为了解决上述另一个技术问题,本发明提供了一种既安全又方便使用的Spark数据库电子密码锁的操作方法,先将用户名和密码设置在Spark数据库中,再将用户名和所述密码设置在Spark应用程序的配置文件中,在将用户名和所述密码设置在Spark应用程序的配置文件中之前,先通过加密程序将设置在Spark数据 库中的密码经过变换加密的步骤得到加密的密码,之后,再将用户名和加密的密码设置在Spark应用程序的配置文件中;启动Spark数据库时,启动程序先读出Spark应用程序的配置文件中加密的密码,再调用解密程序对加密的密码解密,然后,将用户名和解密后的密码与Spark数据库中的用户名和密码相比对,如果配置文件中的用户名与Spark数据库中的用户名相同,同时,解密后的密码与Spark数据库中的密码相同,则Spark数据库才被打开,否则,Spark数据库不能被打开。
所述变换加密的步骤是大小写英文字母相互变化的变换加密的步骤,或者,英文字母和数字加减位移数的变换加密的步骤,或者,将英文字母和数字的ASCII编码变换为base64编码的变换加密的步骤,或者,上述两种变换加密步骤的组合,或者,上述两种以上变换加密步骤的组合。
所述大小写英文字母相互变化的变换加密的步骤是先读取Spark数据库的密码,然后,将小写英文字母变为大写英文字母,将大写英文字母变为小写英文字母;
所述英文字母和数字加减位移数的变换加密的步骤是先以获取密码的位数作为位移数,再对密码做位移,如果密码位数为偶数则做加法位移,如果密码位数为奇数则做减法位移;
所述加法位移变换公式为:
大写字母变换公式:65+(字母ASCII值-65+位移数)/26;
小写字母变换公式:97+(字母ASCII值-97+位移数)/26;
数字变换公式:48+(数字ASCII值-48+位移数)/10;
所述减法位移变换公式为:
大写字母变换公式:65+(字母ASCII值+26-位移数-65)/26;
小写字母变换公式:97+(字母ASCII值+26-位移数-97)/26;
数字变换公式:48+(数字ASCII值+10-位移数-48)/10;
所述将英文字母和数字的ASCII编码变换为base64编码的变换加密的步骤是先将Spark数据库密码中各个字符的八位二进制ASCII码从左到右依次排列,再从左到右或从右到左以每6位的分组,之后在每6位的前面补两个0,形成8位一个字节的形式,按照base64编码表得出相应的字符;如果剩下的字符不足3个八位二进制字节,则用0在其后填充,输出字符使用′=′。
所述base64编码表是标准base64编码表,或者,所述base64编码表是自字义base64编码表;
所述标准base64编码表是依次将A-Z、a-z、0-9、+、/排序,并 按0-63进行编码;
所述自定义base64编码表是依次将+、/、A-Z、a-z、0-9排序,并按0-63进行编码;或者,
所述自定义base64编码表是依次将Z-A、a-z、0-9、+、/排序,并按0-63进行编码;或者,
所述标准base64编码表是先将A-Z、a-z、0-9、+、/排序打乱顺序后,再进行排序,然后,按0-63进行编码。
所述加密程序和所述解密程序与所述Spark数据库的启动程序集成在一起后编译成一个可执行文件,或者,所述加密程序、所述解密程序、所述Spark数据库的启动程序分别进行编译,所述Spark数据库的启动程序可分别调用所述加密程序和所述解密程序。
所述base64编码表设置在Spark数据库的启动程序中,或者,所述base64编码表分别设置在所述加密程序和所述解密程序中,或者,所述base64编码表独立地保存在可移动设备上。
本发明既安全又方便使用的Spark数据库电子密码锁的操作方法与现有技术相比具有以下有益效果。
1、本技术方案由于采用了在将用户名和所述密码设置在Spark应用程序的配置文件中之前,先通过加密程序将设置在Spark数据库中的密码经过变换加密的步骤得到加密的密码,之后,再将用户名和加密的密码设置在Spark应用程序的配置文件中;启动Spark数据库时,启动程序先读出Spark应用程序的配置文件中加密的密码,再调用解密程序对加密的密码解密,然后,将用户名和解密后的密码与Spark数据库中的用户名和密码相比对,如果配置文件中的用户名与Spark数据库中的用户名相同,同时,解密后的密码与Spark数据库中的密码相同,则Spark数据库才被打开,否则,Spark数据库不能被打开的技术手段,所以,用该方法得到的密码设置在配置文件中,可以方便地打开Spark数据库,即使被无关人员获取到用户名和该密码,也无法轻而一举地在其它电脑上启动Spark数据库,通过在配置文件中找到的用户名和该密码登录打开Spark数据库,窃取Spark数据库中的重要数据,因此,该密码可以既安全又方便打开Spark数据库。
2、本技术方案由于采用了所述变换加密的步骤是大小写英文字母相互变化的变换加密的步骤,或者,英文字母和数字加减位移数的变换加密的步骤,或者,将英文字母和数字的ASCII编码变换为base64编码的变换加密的步骤,或者,上述两种变换加密步骤的组合,或者,上述两种以上变换加密步骤的组合的技术手段,所以,可 以采用多种加密的方式对Spark数据库密码进行变换加密,大大增加了破解密码的难度。
3、本技术方案由于采用了所述大小写英文字母相互变化的变换加密的步骤是先读取Spark数据库的密码,然后,将小写英文字母变为大写英文字母,将大写英文字母变为小写英文字母;
所述英文字母和数字加减位移数的变换加密的步骤是先以获取密码的位数作为位移数,再对密码做位移,如果密码位数为偶数则做加法位移,如果密码位数为奇数则做减法位移;
所述加法位移变换公式为:
大写字母变换公式:65+(字母ASCII值-65+位移数)/26;
小写字母变换公式:97+(字母ASCII值-97+位移数)/26;
数字变换公式:48+(数字ASCII值-48+位移数)/10;
所述减法位移变换公式为:
大写字母变换公式:65+(字母ASCII值+26-位移数-65)/26;
小写字母变换公式:97+(字母ASCII值+26-位移数-97)/26;
数字变换公式:48+(数字ASCII值+10-位移数-48)/10;
所述将英文字母和数字的ASCII编码变换为base64编码的变换加密的步骤是先将Spark数据库密码中各个字符的八位二进制ASCII码从左到右依次排列,再从左到右或从右到左以每6位的分组,之后在每6位的前面补两个0,形成8位一个字节的形式,按照base64编码表得出相应的字符;如果剩下的字符不足3个八位二进制字节,则用0在其后填充,输出字符使用′=′的技术手段,所以,又进一步增大了破解密码的难度。
4、本技术方案由于采用了所述base64编码表是标准base64编码表,或者,所述base64编码表是自字义base64编码表;
所述标准base64编码表是依次将A-Z、a-z、0-9、+、/排序,并按0-63进行编码;
所述自定义base64编码表是依次将+、/、A-Z、a-z、0-9排序,并按0-63进行编码;或者,
所述自定义base64编码表是依次将Z-A、a-z、0-9、+、/排序,并按0-63进行编码;或者,
所述标准base64编码表是先将A-Z、a-z、0-9、+、/排序打乱顺序后,再进行排序,然后,按0-63进行编码的技术手段,所以,更进一步增加了破解密码的难度。
5、本技术方案由于采用了所述加密程序和所述解密程序与所述Spark数据库的启动程序集成在一起后编译成一个可执行文件,或者, 所述加密程序、所述解密程序、所述Spark数据库的启动程序分别进行编译,所述Spark数据库的启动程序可分别调用所述加密程序和所述解密程序的技术手段,可给破解密码带来更多的困难。
6、本技术方案由于采用了所述base64编码表设置在Spark数据库的启动程序中,或者,所述base64编码表分别设置在所述加密程序和所述解密程序中,或者,所述base64编码表独立地保存在可移动设备上的技术手段,所以,破解密码几乎是不可能的了。
附图说明
图1是现有技术中设置用户名和密码的流程图。
图2是现有技术中打开Spark数据库的流程图。
图3是本发明设置用户名和密码的流程图。
图4是本发明打开Spark数据库的流程图。
图5是标准base64编码表示意图。
具体实施方式
如图3和图4所示,本实施方式提供了既安全又方便使用的Spark数据库电子密码锁,用户名和密码设置在Spark数据库中,并设置在Spark应用程序的配置文件中,设置在Spark应用程序的配置文件中的密码是通过将设置在Spark数据库中的密码经过变换加密得到的。
本实施方式由于采用了设置在Spark应用程序的配置文件中的密码是通过将设置在Spark数据库中的密码经过变换加密得到的技术手段,所以,可以方便地打开Spark数据库,即使被无关人员获取到用户名和该密码,也无法轻而一举地在其它电脑上启动Spark数据库,通过在配置文件中找到的用户名和该密码登录打开Spark数据库,窃取Spark数据库中的重要数据,因此,该密码可以既安全又方便打开Spark数据库。
作为本实施方式的第一步改进,如图3和图4所示,所述变换加密是大小写英文字母相互变化的变换加密,或者,英文字母和数字加减位移数的变换加密,或者,将英文字母和数字的ASCII编码变换为base64编码的变换加密,或者,上述两种变换加密的组合,或者,上述两种以上变换加密的组合。
本实施方式由于采用了所述变换加密是大小写英文字母相互变化的变换加密,或者,英文字母和数字加减位移数的变换加密,或者,将英文字母和数字的ASCII编码变换为base64编码的变换加密,或 者,上述两种变换加密的组合,或者,上述两种以上变换加密的组合的技术手段,所以,可以采用多种加密的方式对Spark数据库密码进行变换加密,大大增加了破解密码的难度。
作为本实施方式的第二步改进,如图3和图4所示,所述大小写英文字母相互变化的变换加密是读取Spark数据库的密码后,将小写英文字母变为大写英文字母,将大写英文字母变为小写英文字母;如:A变换为a,b变换为B。
所述英文字母和数字加减位移数的变换加密是以获取密码的位数作为位移数,对密码做位移,如果密码位数为偶数则做加法位移,如果密码位数为奇数则做减法位移;
所述加法位移变换公式为:
大写字母变换公式:65+(字母ASCII值-65+位移数)/26;
小写字母变换公式:97+(字母ASCII值-97+位移数)/26;
数字变换公式:48+(数字ASCII值-48+位移数)/10;
例如密码为abcd1234时,密码位数为8位,整除取余后英文字母和数字都要位移8位,使用上面的变换公式分别对英文字母和数字做变换处理,变换后密码变为:ijkl9012。
所述减法位移变换公式为:
大写字母变换公式:65+(字母ASCII值+26-位移数-65)/26;
小写字母变换公式:97+(字母ASCII值+26-位移数-97)/26;
数字变换公式:48+(数字ASCII值+10-位移数-48)/10;
所述将英文字母和数字的ASCII编码变换为base64编码的变换加密是先将Spark数据库密码中各个字符的八位二进制ASCII码从左到右依次排列,再从左到右或从右到左以每6位的分组,之后在每6位的前面补两个0,形成8位一个字节的形式,按照base64编码表得出相应的字符;如果剩下的字符不足3个八位二进制字节,则用0在其后填充,输出字符使用′=′。
本实施方式由于采用了所述大小写英文字母相互变化的变换加密是读取Spark数据库的密码后,将小写英文字母变为大写英文字母,将大写英文字母变为小写英文字母;
所述英文字母和数字加减位移数的变换加密是以获取密码的位数作为位移数,对密码做位移,如果密码位数为偶数则做加法位移,如果密码位数为奇数则做减法位移;
所述加法位移变换公式为:
大写字母变换公式:65+(字母ASCII值-65+位移数)/26;
小写字母变换公式:97+(字母ASCII值-97+位移数)/26;
数字变换公式:48+(数字ASCII值-48+位移数)/10;
所述减法位移变换公式为:
大写字母变换公式:65+(字母ASCII值+26-位移数-65)/26;
小写字母变换公式:97+(字母ASCII值+26-位移数-97)/26;
数字变换公式:48+(数字ASCII值+10-位移数-48)/10;
所述将英文字母和数字的ASCII编码变换为base64编码的变换加密是先将Spark数据库密码中各个字符的八位二进制ASCII码从左到右依次排列,再从左到右或从右到左以每6位的分组,之后在每6位的前面补两个0,形成8位一个字节的形式,按照base64编码表得出相应的字符;如果剩下的字符不足3个八位二进制字节,则用0在其后填充,输出字符使用′=′。的技术手段,所以,又进一步增大了破解密码的难度。
作为本实施方式的第三步改进,如图5所示,所述base64编码表是标准base64编码表,或者,所述base64编码表是自字义base64编码表;
所述标准base64编码表是依次将A-Z、a-z、0-9、+、/排序,并按0-63进行编码;
所述自定义base64编码表是依次将+、/、A-Z、a-z、0-9排序,并按0-63进行编码;类似的自定义base64编码表可以很多种。
也可以是,所述自定义base64编码表是依次将Z-A、a-z、0-9、+、/排序,并按0-63进行编码;类似的自定义base64编码表可以很多种。
也可以是,所述标准base64编码表是先将A-Z、a-z、0-9、+、/排序打乱顺序后,再进行排序,然后,按0-63进行编码;类似的自定义base64编码表几乎有无数种。
本实施方式由于采用了所述base64编码表是标准base64编码表,或者,所述base64编码表是自字义base64编码表;
所述标准base64编码表是依次将A-Z、a-z、0-9、+、/排序,并按0-63进行编码;
所述自定义base64编码表是依次将+、/、A-Z、a-z、0-9排序,并按0-63进行编码;或者,
所述自定义base64编码表是依次将Z-A、a-z、0-9、+、/排序,并按0-63进行编码;或者,
所述标准base64编码表是先将A-Z、a-z、0-9、+、/排序打乱顺序后,再进行排序,然后,按0-63进行编码的技术手段,所以,更进一步增加了破解密码的难度。
如图3和图4所示,本发明提供了一种既安全又方便使用的Spark数据库电子密码锁的操作方法,先将用户名和密码设置在Spark数据库中,再将用户名和所述密码设置在Spark应用程序的配置文件中,在将用户名和所述密码设置在Spark应用程序的配置文件中之前,先通过加密程序将设置在Spark数据库中的密码经过变换加密的步骤得到加密的密码,之后,再将用户名和加密的密码设置在Spark应用程序的配置文件中;启动Spark数据库时,启动程序先读出Spark应用程序的配置文件中加密的密码,再调用解密程序对加密的密码解密,然后,将用户名和解密后的密码与Spark数据库中的用户名和密码相比对,如果配置文件中的用户名与Spark数据库中的用户名相同,同时,解密后的密码与Spark数据库中的密码相同,则Spark数据库才被打开,否则,Spark数据库不能被打开。
本实施方式由于采用了在将用户名和所述密码设置在Spark应用程序的配置文件中之前,先通过加密程序将设置在Spark数据库中的密码经过变换加密的步骤得到加密的密码,之后,再将用户名和加密的密码设置在Spark应用程序的配置文件中;启动Spark数据库时,启动程序先读出Spark应用程序的配置文件中加密的密码,再调用解密程序对加密的密码解密,然后,将用户名和解密后的密码与Spark数据库中的用户名和密码相比对,如果配置文件中的用户名与Spark数据库中的用户名相同,同时,解密后的密码与Spark数据库中的密码相同,则Spark数据库才被打开,否则,Spark数据库不能被打开的技术手段,所以,用该方法得到的密码设置在配置文件中,可以方便地打开Spark数据库,即使被无关人员获取到用户名和该密码,也无法轻而一举地在其它电脑上启动Spark数据库,通过在配置文件中找到的用户名和该密码登录打开Spark数据库,窃取Spark数据库中的重要数据,因此,该密码可以既安全又方便打开Spark数据库。
作为本实施方式的第一步改进,如图3和图4所示,所述变换加密的步骤是大小写英文字母相互变化的变换加密的步骤,或者,英文字母和数字加减位移数的变换加密的步骤,或者,将英文字母和数字的ASCII编码变换为base64编码的变换加密的步骤,或者,上述两种变换加密步骤的组合,或者,上述两种以上变换加密步骤的组合。
本实施方式由于采用了所述变换加密的步骤是大小写英文字母相互变化的变换加密的步骤,或者,英文字母和数字加减位移数的变换加密的步骤,或者,将英文字母和数字的ASCII编码变换为base64 编码的变换加密的步骤,或者,上述两种变换加密步骤的组合,或者,上述两种以上变换加密步骤的组合的技术手段,所以,可以采用多种加密的方式对Spark数据库密码进行变换加密,大大增加了破解密码的难度。
作为本实施方式的第二步改进,如图3和图4所示,所述大小写英文字母相互变化的变换加密的步骤是先读取Spark数据库的密码,然后,将小写英文字母变为大写英文字母,将大写英文字母变为小写英文字母;
所述英文字母和数字加减位移数的变换加密的步骤是先以获取密码的位数作为位移数,再对密码做位移,如果密码位数为偶数则做加法位移,如果密码位数为奇数则做减法位移;
所述加法位移变换公式为:
大写字母变换公式:65+(字母ASCII值-65+位移数)/26;
小写字母变换公式:97+(字母ASCII值-97+位移数)/26;
数字变换公式:48+(数字ASCII值-48+位移数)/10;
所述减法位移变换公式为:
大写字母变换公式:65+(字母ASCII值+26-位移数-65)/26;
小写字母变换公式:97+(字母ASCII值+26-位移数-97)/26;
数字变换公式:48+(数字ASCII值+10-位移数-48)/10;
所述将英文字母和数字的ASCII编码变换为base64编码的变换加密的步骤是先将Spark数据库密码中各个字符的八位二进制ASCII码从左到右依次排列,再从左到右或从右到左以每6位的分组,之后在每6位的前面补两个0,形成8位一个字节的形式,按照base64编码表得出相应的字符;如果剩下的字符不足3个八位二进制字节,则用0在其后填充,输出字符使用′=′。
本实施方式由于采用了所述大小写英文字母相互变化的变换加密的步骤是先读取Spark数据库的密码,然后,将小写英文字母变为大写英文字母,将大写英文字母变为小写英文字母;
所述英文字母和数字加减位移数的变换加密的步骤是先以获取密码的位数作为位移数,再对密码做位移,如果密码位数为偶数则做加法位移,如果密码位数为奇数则做减法位移;
所述加法位移变换公式为:
大写字母变换公式:65+(字母ASCII值-65+位移数)/26;
小写字母变换公式:97+(字母ASCII值-97+位移数)/26;
数字变换公式:48+(数字ASCII值-48+位移数)/10;
所述减法位移变换公式为:
大写字母变换公式:65+(字母ASCII值+26-位移数-65)/26;
小写字母变换公式:97+(字母ASCII值+26-位移数-97)/26;
数字变换公式:48+(数字ASCII值+10-位移数-48)/10;
所述将英文字母和数字的ASCII编码变换为base64编码的变换加密的步骤是先将Spark数据库密码中各个字符的八位二进制ASCII码从左到右依次排列,再从左到右或从右到左以每6位的分组,之后在每6位的前面补两个0,形成8位一个字节的形式,按照base64编码表得出相应的字符;如果剩下的字符不足3个八位二进制字节,则用0在其后填充,输出字符使用′=′的技术手段,所以,又进一步增大了破解密码的难度。
作为本实施方式的第三步改进,如图5所示,所述base64编码表是标准base64编码表,或者,所述base64编码表是自字义base64编码表;
所述标准base64编码表是依次将A-Z、a-z、0-9、+、/排序,并按0-63进行编码;
所述自定义base64编码表是依次将+、/、A-Z、a-z、0-9排序,并按0-63进行编码;或者,
所述自定义base64编码表是依次将Z-A、a-z、0-9、+、/排序,并按0-63进行编码;或者,
所述标准base64编码表是先将A-Z、a-z、0-9、+、/排序打乱顺序后,再进行排序,然后,按0-63进行编码。
本实施方式由于采用了所述base64编码表是标准base64编码表,或者,所述base64编码表是自字义base64编码表;
所述标准base64编码表是依次将A-Z、a-z、0-9、+、/排序,并按0-63进行编码;
所述自定义base64编码表是依次将+、/、A-Z、a-z、0-9排序,并按0-63进行编码;或者,
所述自定义base64编码表是依次将Z-A、a-z、0-9、+、/排序,并按0-63进行编码;或者,
所述标准base64编码表是先将A-Z、a-z、0-9、+、/排序打乱顺序后,再进行排序,然后,按0-63进行编码的技术手段,所以,更进一步增加了破解密码的难度。
作为本实施方式的第四步改进,所述加密程序和所述解密程序与所述Spark数据库的启动程序集成在一起后编译成一个可执行文件,或者,所述加密程序、所述解密程序、所述Spark数据库的启动程序分别进行编译,所述Spark数据库的启动程序可分别调用所述加 密程序和所述解密程序。
本实施方式由于采用了所述加密程序和所述解密程序与所述Spark数据库的启动程序集成在一起后编译成一个可执行文件,或者,所述加密程序、所述解密程序、所述Spark数据库的启动程序分别进行编译,所述Spark数据库的启动程序可分别调用所述加密程序和所述解密程序的技术手段,可给破解密码带来更多的困难。
作为本实施方式的第五步改进,所述base64编码表设置在Spark数据库的启动程序中,或者,所述base64编码表分别设置在所述加密程序和所述解密程序中,或者,所述base64编码表独立地保存在可移动设备上。
本实施方式由于采用了所述base64编码表设置在Spark数据库的启动程序中,或者,所述base64编码表分别设置在所述加密程序和所述解密程序中,或者,所述base64编码表独立地保存在可移动设备上的技术手段,所以,破解密码几乎是不可能的了。
需要说明的是,以上参照附图所描述的各个实施例仅用以说明本发明而非限制本发明的范围,本领域的普通技术人员应当理解,在不脱离本发明的精神和范围的前提下对本发明进行的修改或者等同替换,均应涵盖在本发明的范围之内。此外,除上下文另有所指外,以单数形式出现的词包括复数形式,反之亦然。另外,除非特别说明,那么任何实施例的全部或一部分可结合任何其它实施例的全部或一部分来使用。

Claims (10)

  1. 一种既安全又方便使用的Spark数据库电子密码锁,用户名和密码设置在Spark数据库中,并设置在Spark应用程序的配置文件中,其特征在于:设置在Spark应用程序的配置文件中的密码是通过将设置在Spark数据库中的密码经过变换加密得到的。
  2. 根据权利要求1所述既安全又方便使用的Spark数据库电子密码锁,其特征在于:所述变换加密是大小写英文字母相互变化的变换加密,或者,英文字母和数字加减位移数的变换加密,或者,将英文字母和数字的ASCII编码变换为base64编码的变换加密,或者,上述两种变换加密的组合,或者,上述两种以上变换加密的组合。
  3. 根据权利要求2所述既安全又方便使用的Spark数据库电子密码锁,其特征在于:
    所述大小写英文字母相互变化的变换加密是读取Spark数据库的密码后,将小写英文字母变为大写英文字母,将大写英文字母变为小写英文字母;
    所述英文字母和数字加减位移数的变换加密是以获取密码的位数作为位移数,对密码做位移,如果密码位数为偶数则做加法位移,如果密码位数为奇数则做减法位移;
    所述加法位移变换公式为:
    大写字母变换公式:65+(字母ASCII值-65+位移数)/26;
    小写字母变换公式:97+(字母ASCII值-97+位移数)/26;
    数字变换公式:48+(数字ASCII值-48+位移数)/10;
    所述减法位移变换公式为:
    大写字母变换公式:65+(字母ASCII值+26-位移数-65)/26;
    小写字母变换公式:97+(字母ASCII值+26-位移数-97)/26;
    数字变换公式:48+(数字ASCII值+10-位移数-48)/10;
    所述将英文字母和数字的ASCII编码变换为base64编码的变换加密是先将Spark数据库密码中各个字符的八位二进制ASCII码从左到右依次排列,再从左到右或从右到左以每6位的分组,之后在每6位的前面补两个0,形成8位一个字节的形式,按照base64编码表得出相应的字符;如果剩下的字符不足3个八位二进制字节,则用0在其后填充,输出字符使用′=′。
  4. 根据权利要求3所述既安全又方便使用的Spark数据库电子密码锁,其特征在于:所述base64编码表是标准base64编码表,或者,所述base64编码表是自字义base64编码表;
    所述标准base64编码表是依次将A-Z、a-z、0-9、+、/排序,并按0-63进行编码;
    所述自定义base64编码表是依次将+、/、A-Z、a-z、0-9排序,并按0-63进行编码;或者,
    所述自定义base64编码表是依次将Z-A、a-z、0-9、+、/排序,并按0-63进行编码;或者,
    所述标准base64编码表是先将A-Z、a-z、0-9、+、/排序打乱顺序后,再进行排序,然后,按0-63进行编码。
  5. 一种既安全又方便使用的Spark数据库电子密码锁的操作方法,先将用户名和密码设置在Spark数据库中,再将用户名和所述密码设置在Spark应用程序的配置文件中,其特征在于:在将用户名和所述密码设置在Spark应用程序的配置文件中之前,先通过加密程序将设置在Spark数据库中的密码经过变换加密的步骤得到加密的密码,之后,再将用户名和加密的密码设置在Spark应用程序的配置文件中;启动Spark数据库时,启动程序先读出Spark应用程序的配置文件中加密的密码,再调用解密程序对加密的密码解密,然后,将用户名和解密后的密码与Spark数据库中的用户名和密码相比对,如果配置文件中的用户名与Spark数据库中的用户名相同,同时,解密后的密码与Spark数据库中的密码相同,则Spark数据库才被打开,否则,Spark数据库不能被打开。
  6. 根据权利要求5所述既安全又方便使用的Spark数据库电子密码锁的操作方法,其特征在于:所述变换加密的步骤是大小写英文字母相互变化的变换加密的步骤,或者,英文字母和数字加减位移数的变换加密的步骤,或者,将英文字母和数字的ASCII编码变换为base64编码的变换加密的步骤,或者,上述两种变换加密步骤的组合,或者,上述两种以上变换加密步骤的组合。
  7. 根据权利要求6所述既安全又方便使用的Spark数据库电子密码锁的操作方法,其特征在于:
    所述大小写英文字母相互变化的变换加密的步骤是先读取Spark数据库的密码,然后,将小写英文字母变为大写英文字母,将大写英 文字母变为小写英文字母;
    所述英文字母和数字加减位移数的变换加密的步骤是先以获取密码的位数作为位移数,再对密码做位移,如果密码位数为偶数则做加法位移,如果密码位数为奇数则做减法位移;
    所述加法位移变换公式为:
    大写字母变换公式:65+(字母ASCII值-65+位移数)/26;
    小写字母变换公式:97+(字母ASCII值-97+位移数)/26;
    数字变换公式:48+(数字ASCII值-48+位移数)/10;
    所述减法位移变换公式为:
    大写字母变换公式:65+(字母ASCII值+26-位移数-65)/26;
    小写字母变换公式:97+(字母ASCII值+26-位移数-97)/26;
    数字变换公式:48+(数字ASCII值+10-位移数-48)/10;
    所述将英文字母和数字的ASCII编码变换为base64编码的变换加密的步骤是先将Spark数据库密码中各个字符的八位二进制ASCII码从左到右依次排列,再从左到右或从右到左以每6位的分组,之后在每6位的前面补两个0,形成8位一个字节的形式,按照base64编码表得出相应的字符;如果剩下的字符不足3个八位二进制字节,则用0在其后填充,输出字符使用′=′。
  8. 根据权利要求7所述既安全又方便使用的Spark数据库电子密码锁的操作方法,其特征在于:所述base64编码表是标准base64编码表,或者,所述base64编码表是自字义base64编码表;
    所述标准base64编码表是依次将A-Z、a-z、0-9、+、/排序,并按0-63进行编码;
    所述自定义base64编码表是依次将+、/、A-Z、a-z、0-9排序,并按0-63进行编码;或者,
    所述自定义base64编码表是依次将Z-A、a-z、0-9、+、/排序,并按0-63进行编码;或者,
    所述标准base64编码表是先将A-Z、a-z、0-9、+、/排序打乱顺序后,再进行排序,然后,按0-63进行编码。
  9. 根据权利要求5至8之一所述既安全又方便使用的Spark数据库电子密码锁的操作方法,其特征在于:所述加密程序和所述解密程序与所述Spark数据库的启动程序集成在一起后编译成一个可执行文件,或者,所述加密程序、所述解密程序、所述Spark数据库的启动程序分别进行编译,所述Spark数据库的启动程序可分别调用所述 加密程序和所述解密程序。
  10. 根据权利要求5所述既安全又方便使用的Spark数据库电子密码锁的操作方法,其特征在于:所述base64编码表设置在Spark数据库的启动程序中,或者,所述base64编码表分别设置在所述加密程序和所述解密程序中,或者,所述base64编码表独立地保存在可移动设备上。
PCT/CN2016/096758 2015-12-25 2016-08-25 一种spark数据库电子密码锁及其操作方法 WO2017107530A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510992627.4 2015-12-25
CN201510992627.4A CN105631346A (zh) 2015-12-25 2015-12-25 一种既安全又方便使用的Spark数据库电子密码锁及其操作方法

Publications (1)

Publication Number Publication Date
WO2017107530A1 true WO2017107530A1 (zh) 2017-06-29

Family

ID=56046267

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/096758 WO2017107530A1 (zh) 2015-12-25 2016-08-25 一种spark数据库电子密码锁及其操作方法

Country Status (2)

Country Link
CN (1) CN105631346A (zh)
WO (1) WO2017107530A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105631346A (zh) * 2015-12-25 2016-06-01 深圳市华讯方舟软件技术有限公司 一种既安全又方便使用的Spark数据库电子密码锁及其操作方法
CN107066876A (zh) * 2017-01-18 2017-08-18 捷开通讯(深圳)有限公司 一种自动设置密码的密码管理装置及管理方法
CN109284302B (zh) * 2018-08-10 2020-12-01 新华三大数据技术有限公司 数据处理方法及装置
CN117725615B (zh) * 2023-12-25 2024-05-28 杭州圣鼎科技有限公司 基于双向交互信息共享的生产信息记录方法、系统及介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030242A (zh) * 2007-02-12 2007-09-05 深圳市迈科龙电子有限公司 一种控制数据库安全访问的方法
CN103780457A (zh) * 2014-01-02 2014-05-07 东南大学 一种基于边界检测的移动智能终端安全检测方法
CN105631346A (zh) * 2015-12-25 2016-06-01 深圳市华讯方舟软件技术有限公司 一种既安全又方便使用的Spark数据库电子密码锁及其操作方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6128624A (en) * 1997-11-12 2000-10-03 Ncr Corporation Collection and integration of internet and electronic commerce data in a database during web browsing
CN100464338C (zh) * 2007-06-25 2009-02-25 浪潮集团山东通用软件有限公司 一种应用软件安全机制与大型数据库安全机制绑定方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030242A (zh) * 2007-02-12 2007-09-05 深圳市迈科龙电子有限公司 一种控制数据库安全访问的方法
CN103780457A (zh) * 2014-01-02 2014-05-07 东南大学 一种基于边界检测的移动智能终端安全检测方法
CN105631346A (zh) * 2015-12-25 2016-06-01 深圳市华讯方舟软件技术有限公司 一种既安全又方便使用的Spark数据库电子密码锁及其操作方法

Also Published As

Publication number Publication date
CN105631346A (zh) 2016-06-01

Similar Documents

Publication Publication Date Title
CN106161006B (zh) 一种数字加密算法
US10015163B2 (en) Apparatus and method for cryptographic operations using enhanced knowledge factor credentials
US8862897B2 (en) Increasing data security in enterprise applications by using formatting, checksums, and encryption to detect tampering of a data buffer
US8600048B1 (en) Format-translating encryption systems
WO2017107530A1 (zh) 一种spark数据库电子密码锁及其操作方法
US9208304B2 (en) Method for web service user authentication
US9608822B2 (en) Method for generating an HTML document that contains encrypted files and the code necessary for decrypting them when a valid passphrase is provided
US20130339252A1 (en) Format-preserving cryptographic systems
US10904001B2 (en) Data format-preserving encryption, tokenization, and access control for vaultless systems and methods
CN106131049A (zh) 一种数据传输加解密的方法
Geetha et al. Tamilian cryptography: an efficient hybrid symmetric key encryption algorithm
Tan et al. A Deep Exploration of BitLocker Encryption and Security Analysis
Rafat et al. Secure digital steganography for ASCII text documents
JP5411034B2 (ja) データベース暗号化システム及び方法
CA2763860C (en) System, architecture and method for secure encryption and decryption
CN116760546A (zh) 基于云环境的模块化密码服务方法
US11601291B2 (en) Authentication method and device for matrix pattern authentication
US20230104633A1 (en) Management system and method for user authentication on password based systems
Griffin Adaptive weak secrets for authenticated key exchange
Rahalkar et al. A Secure Password Manager
CN104022871B (zh) 基于对称式的加密方法
CN110941815A (zh) 一种新型密码
US20030138099A1 (en) Method for computer-based encryption and decryption of data
Apelbaum User Authentication principles, theory and practice
Krotkiewicz An In-Depth Look into Cryptographic Hashing Algorithms

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16877342

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16877342

Country of ref document: EP

Kind code of ref document: A1