CN112364368A - Telephone number encryption storage method - Google Patents
Telephone number encryption storage method Download PDFInfo
- Publication number
- CN112364368A CN112364368A CN202011394279.8A CN202011394279A CN112364368A CN 112364368 A CN112364368 A CN 112364368A CN 202011394279 A CN202011394279 A CN 202011394279A CN 112364368 A CN112364368 A CN 112364368A
- Authority
- CN
- China
- Prior art keywords
- letter
- key
- comparison table
- letters
- alphabet
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/126—Character encoding
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- Computer Security & Cryptography (AREA)
- Bioethics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Telephone Function (AREA)
Abstract
The invention discloses a telephone number encryption storage method, which comprises the steps of dynamically creating a KEY and creating a letter comparison set; carrying out md5 encryption on KEY to intercept the first 10-bit string; performing ascii code value taking on each character to form a decimal array, sequentially taking the remainder of the letter comparison set to obtain a p value, obtaining the letters at the corresponding positions of the letter comparison set, deleting the letters to be used as a new letter comparison set, repeating the steps until a 0-9 letter comparison table is obtained, and replacing and storing the telephone numbers one by one according to the letter comparison table. According to the invention, KEY is dynamically established for the sensitive information of the mobile phone number of the database, a 0-9 letter comparison table is generated through the KEY, and then the telephone number is replaced and stored one by one according to the letter comparison table, so that the encryption effect is achieved, and sensitive data leakage is avoided; when searching telephone numbers, the same method is adopted to replace the telephone numbers to be searched one by one for searching, thereby achieving the purpose of quick searching.
Description
Technical Field
The invention relates to the technical field of information security, in particular to a telephone number encryption storage method.
Background
In the prior art, telephone numbers are directly stored, a field is directly created for the mobile phone numbers submitted by users, and content storage is carried out, wherein the stored content is consistent with the actual mobile phone number information of the users; this results in the user's phone number data being revealed if the memory or database is once breached. In the prior art, the traditional encryption method such as md5 is adopted for storage, but data search is inconvenient, and the purpose of quick matching or query cannot be achieved.
Disclosure of Invention
The invention aims to provide a telephone number encryption storage method, which is used for solving the problems that in the prior art, data leakage is easy to occur when telephone numbers are directly stored, and data search is inconvenient to occur when the telephone numbers are stored by adopting a traditional encryption method.
The invention solves the problems through the following technical scheme:
a method for encrypting and storing telephone numbers includes dynamically creating KEY, generating letter comparison table of 0-9 by KEY, and replacing and storing telephone numbers one by one according to letter comparison table.
Dynamically establishing KEY, generating a 0-9 digit comparison table through the KEY, and replacing and storing the telephone numbers one by one according to the comparison table to achieve the encryption storage method. During retrieval, the retrieved telephone number keywords are also replaced one by one to achieve the purpose of quick retrieval.
The method for generating the letter comparison table of 0-9 by KEY is as follows:
a: forming a comparison set by using 26-bit letters;
b: carrying out md5 encryption on KEY, and intercepting the first 10 bits of the encrypted string to form a character string;
c: obtaining corresponding decimal ascii codes of each character in the character string according to an ascii table to obtain 10 decimal digits; setting n as 1 as initial value, n belongs to positive integer;
d: starting the p-value operation from the nth of the 10 decimal numbers:
p=aNum%maxLen+1
wherein, p represents the letter of the number of the rest letters in the comparison set from the 1 st position; aNum represents the nth number in 10 decimal numbers; maxLen represents the number of the remaining letters in the comparison set;
e: comparing the letter comparison table to extract the letter at the p-th position, forming a new letter set by the residual letters, and putting the extracted letters into the array in sequence;
f: if n is less than 10, n is n +1, returning to D, otherwise, entering the next step;
g: an alphabet comparison table of 0-9 is formed based on the array values.
Dynamically creating KEY for the retrieved telephone number, generating an alphabet comparison table of 0-9 by the KEY, and replacing the telephone number with corresponding alphabet according to the alphabet comparison table to search and query.
Compared with the prior art, the invention has the following advantages and beneficial effects:
according to the invention, KEY is dynamically established for the sensitive information of the mobile phone number of the database, a 0-9 letter comparison table is generated through the KEY, and then the telephone number is replaced and stored one by one according to the letter comparison table, so that the encryption effect is achieved, and sensitive data leakage is avoided; when searching telephone numbers, the same method is adopted to replace the telephone numbers to be searched one by one for searching, thereby achieving the purpose of quick searching.
Drawings
FIG. 1 is a flow chart of the present invention for dynamic KEY conversion to 10 decimal numbers;
FIG. 2 is a flow chart for converting 10 decimal digits to digits from 0-9.
Detailed Description
The present invention will be described in further detail with reference to examples, but the embodiments of the present invention are not limited thereto.
Example (b):
referring to fig. 1, a method for storing a telephone number in an encrypted manner includes:
create KEY value: the KEY value is a generated character string composed of 6-bit numbers and letters, for example, the KEY value is: 6AB 90E.
Creating a comparison set composed of 26-bit fixed letter set character strings, such as a comparison set composed of an uppercase English alphabet: ABCDEFGHIJKLMNOPQRSTUWXYZ.
The lower case 32-bit encryption string is encrypted according to md5 for the KEY value:
e1b5e943479a9d303eb790be8ed62efd, then the first 10 bits of the 32-bit encrypted string are taken to form a new 10-bit length string: e1b5e94347 and taking the ascii code value for each digit character to form a decimal digit array of 10: {101,49,98,53,101,57,51,52,51,55 };
the generation method of the 0-9 digit-to-letter comparison table is shown in fig. 2:
the letter formula is taken from the comparison set as: p is aNum% maxLen +1, p represents the letter of the alignment set from the 1 st digit to the number of digits, aNum represents a 10-system number, and maxLen represents the number of the remaining letters in the letter set.
And sequentially obtaining aNum values from the digital array, substituting the aNum values into a formula to calculate the p value, wherein the specific calculation process comprises the following steps:
the aNum value takes the first value of the array as 101, maxLen takes the length of the current letter set as 26, and the substitution formula is as follows: p 101% 26+1, calculated p 24, and the 24 th letter from the current letter set "ABCDEFGHIJKLMNOPQRSTUVWXYZ: x, removing the letter X in the current letter set to form a new letter set as:
“ABCDEFGHIJKLMNOPQRSTUVWYZ”。
and then the results obtained by the same calculation method are as follows:
the letter is taken as Z for the second time, and the new letter set is ABCDEFGHIJKLMNOPQRSTUWY;
the third letter is C, and the new letter set is: ABDEFGHIJKLMNOPQRSTHWY;
the fourth letter is I, and the new letter set is: ABDEFGHKLMNOPQRSTHWY;
the fifth letter is P, and the new letter set is: ABDEFGHKLMNOQRSTUVWY;
the sixth value letter is S, and the new letter set is: ABDEFGHKLMNOQRTUFY;
the seventh letter is O, and the new letter set is: ABDEFGHKLMNQRTEWWY;
the eighth time value letter is R, and the new letter set is: ABDEFGHJKLMNQTUVWY;
the ninth letter is W, and the new letter set is: ABDEFGHJKLMNQTUVY;
the tenth value letter is F, and the new letter set is: ABDEGHJKLMNQTUVY.
The resulting letter comparison table is shown in table 1.
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
X | Z | C | I | P | S | O | R | W | F |
TABLE 1 alphabet comparison table
The process of replacing a telephone number according to a 0-9 digit to letter comparison table is as follows:
the collected telephone numbers are: 13880680467, according to the first digit 1, the letter in the lookup table is Z, the second digit 3 corresponds to the letter is I, and the final replacement result is: ZIWWXOWXPOR.
The telephone number keyword search and the process of replacing the searched content are as follows:
the collected mobile phone number keyword is 0467, then according to the first digit 0, the letter of the query comparison table is X, the letter corresponding to the second digit 4 is P, and the final replacement result is: XPOR, the collected telephone numbers can be found by inquiring XPOR according to the database: 13880680467.
Although the present invention has been described herein with reference to the illustrated embodiments thereof, which are intended to be preferred embodiments of the present invention, it is to be understood that the invention is not limited thereto, and that numerous other modifications and embodiments can be devised by those skilled in the art that will fall within the spirit and scope of the principles of this disclosure.
Claims (3)
1. A telephone number encryption storage method is characterized in that KEY is dynamically established, a 0-9 letter comparison table is generated through the KEY, and then telephone numbers are replaced and stored one by one according to the letter comparison table.
2. The method for encrypting and storing the telephone numbers according to claim 1, wherein the method for generating the alphabet comparison table of 0-9 by KEY comprises the following steps:
a: forming a comparison set by using 26-bit letters;
b: carrying out md5 encryption on KEY, and intercepting the first 10 bits of the encrypted string to form a character string;
c: obtaining corresponding decimal ascii codes of each character in the character string according to an ascii table to obtain 10 decimal digits; setting n as 1 as initial value, n belongs to positive integer;
d: starting the p-value operation from the nth of the 10 decimal numbers:
p=aNum%maxLen+1
wherein, p represents the letter of the number of the rest letters in the comparison set from the 1 st position; aNum represents the nth number in 10 decimal numbers; maxLen represents the number of the remaining letters in the comparison set;
e: comparing the letter comparison table to extract the letter at the p-th position, forming a new letter set by the residual letters, and putting the extracted letters into the array in sequence;
f: if n is less than 10, n is n +1, returning to D, otherwise, entering the next step;
g: an alphabet comparison table of 0-9 is formed based on the array values.
3. The method as claimed in claim 1, further comprising dynamically creating KEY for the retrieved phone number, generating an alphabet comparison table of 0-9 by KEY, and performing search query on the phone number by replacing the corresponding alphabet with the corresponding alphabet according to the alphabet comparison table.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011394279.8A CN112364368B (en) | 2020-12-02 | 2020-12-02 | Telephone number encryption storage method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011394279.8A CN112364368B (en) | 2020-12-02 | 2020-12-02 | Telephone number encryption storage method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112364368A true CN112364368A (en) | 2021-02-12 |
CN112364368B CN112364368B (en) | 2022-06-03 |
Family
ID=74536636
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011394279.8A Active CN112364368B (en) | 2020-12-02 | 2020-12-02 | Telephone number encryption storage method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112364368B (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20060038836A (en) * | 2004-11-01 | 2006-05-04 | 주식회사 팬택 | A method saving or searching a number data transforming format |
CN102693277A (en) * | 2012-04-11 | 2012-09-26 | 佳都新太科技股份有限公司 | Mass telephone number search method |
CN104657481A (en) * | 2015-02-26 | 2015-05-27 | 华为技术有限公司 | Data storage method and device and data query method and device |
CN105245694A (en) * | 2015-09-06 | 2016-01-13 | 高金铎 | Numeric code and non-numeric code conversion method, communication system and communication method |
CN105426445A (en) * | 2015-11-06 | 2016-03-23 | 天津佳宁坤祥科技有限公司 | Format-preserving data desensitization method |
CN106131051A (en) * | 2016-08-16 | 2016-11-16 | 深圳神盾电子科技有限公司 | Information encryption and decryption method and device |
CN107122412A (en) * | 2017-03-31 | 2017-09-01 | 合肥天馈互联网技术有限公司 | A kind of magnanimity telephone number Rapid matching search method |
CN108418684A (en) * | 2018-03-09 | 2018-08-17 | 江苏科建教育软件有限责任公司 | A kind of character string symmetric cryptography and decryption method |
CN110213275A (en) * | 2019-06-05 | 2019-09-06 | 四川长虹电器股份有限公司 | Information query system and method |
CN111885251A (en) * | 2020-07-30 | 2020-11-03 | 谭武韬 | Mobile phone address book number protection method |
CN111967026A (en) * | 2020-07-22 | 2020-11-20 | 深圳市道旅旅游科技股份有限公司 | Method and device for encrypting and decrypting redemption code and computer equipment |
-
2020
- 2020-12-02 CN CN202011394279.8A patent/CN112364368B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20060038836A (en) * | 2004-11-01 | 2006-05-04 | 주식회사 팬택 | A method saving or searching a number data transforming format |
CN102693277A (en) * | 2012-04-11 | 2012-09-26 | 佳都新太科技股份有限公司 | Mass telephone number search method |
CN104657481A (en) * | 2015-02-26 | 2015-05-27 | 华为技术有限公司 | Data storage method and device and data query method and device |
CN105245694A (en) * | 2015-09-06 | 2016-01-13 | 高金铎 | Numeric code and non-numeric code conversion method, communication system and communication method |
CN105426445A (en) * | 2015-11-06 | 2016-03-23 | 天津佳宁坤祥科技有限公司 | Format-preserving data desensitization method |
CN106131051A (en) * | 2016-08-16 | 2016-11-16 | 深圳神盾电子科技有限公司 | Information encryption and decryption method and device |
CN107122412A (en) * | 2017-03-31 | 2017-09-01 | 合肥天馈互联网技术有限公司 | A kind of magnanimity telephone number Rapid matching search method |
CN108418684A (en) * | 2018-03-09 | 2018-08-17 | 江苏科建教育软件有限责任公司 | A kind of character string symmetric cryptography and decryption method |
CN110213275A (en) * | 2019-06-05 | 2019-09-06 | 四川长虹电器股份有限公司 | Information query system and method |
CN111967026A (en) * | 2020-07-22 | 2020-11-20 | 深圳市道旅旅游科技股份有限公司 | Method and device for encrypting and decrypting redemption code and computer equipment |
CN111885251A (en) * | 2020-07-30 | 2020-11-03 | 谭武韬 | Mobile phone address book number protection method |
Non-Patent Citations (3)
Title |
---|
M.H.MOON等: ""A Cryptographic Algorithm Based on ASCII and Number System Conversions along with a Cyclic Mathematical Function,"", 《2019 INTERNATIONAL CONFERENCE ON COMPUTER, COMMUNICATION, CHEMICAL, MATERIALS AND ELECTRONIC ENGINEERING (IC4ME2)》 * |
徐新爱 等: "《数据结构实用教程》", 31 January 2013 * |
陈湘 等: ""数据加密技术",陈湘 等", 《重型机械科技》 * |
Also Published As
Publication number | Publication date |
---|---|
CN112364368B (en) | 2022-06-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8745077B2 (en) | Searching and matching of data | |
CN111868710B (en) | Random extraction forest index structure for searching large-scale unstructured data | |
US9721009B2 (en) | Primary and foreign key relationship identification with metadata analysis | |
US20130141259A1 (en) | Method and system for data compression | |
CN1890669A (en) | Incremental search of keyword strings | |
WO2004062110A1 (en) | Data compressing method, program and apparatus | |
CN1132372A (en) | Efficient and secure update of software and data | |
CN103294776A (en) | Smartphone address book fuzzy search method | |
TWI604318B (en) | Method of data sorting | |
CN111801665A (en) | Hierarchical Locality Sensitive Hash (LSH) partition indexing for big data applications | |
CN104268157A (en) | Device and method for error correction in data search | |
CN106131139A (en) | The encryption of the floating data of a kind of cloud relational database and querying method | |
CN113255007B (en) | Safe hidden three-factor query method | |
CN108416229B (en) | Data desensitization method for category information | |
CN102867049A (en) | Chinese PINYIN quick word segmentation method based on word search tree | |
CN113626645B (en) | Hierarchical optimization efficient ciphertext fuzzy retrieval method and related equipment | |
CN112364368B (en) | Telephone number encryption storage method | |
CN108399152B (en) | Compression representation method, system, storage medium and rule matching device for digital search tree | |
CN110941831A (en) | Vulnerability matching method based on fragmentation technology | |
CN110795617A (en) | Error correction method and related device for search terms | |
Goel et al. | Efficient indexing techniques for record matching and deduplication | |
CN115577374A (en) | Encryption fusion storage method, device and medium based on MD5 | |
CN109657108B (en) | Domain name asset data storage and query method and system | |
JP2005004560A (en) | Method for creating inverted file | |
CN110287147B (en) | Character string sorting method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |