CN104156451A - Data storage managing method and system - Google Patents

Data storage managing method and system Download PDF

Info

Publication number
CN104156451A
CN104156451A CN201410405493.7A CN201410405493A CN104156451A CN 104156451 A CN104156451 A CN 104156451A CN 201410405493 A CN201410405493 A CN 201410405493A CN 104156451 A CN104156451 A CN 104156451A
Authority
CN
China
Prior art keywords
data
encrypted
random number
file
byte
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.)
Pending
Application number
CN201410405493.7A
Other languages
Chinese (zh)
Inventor
黄友能
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yiwuyishi Network Technology Co ltd
Original Assignee
Shenzhen Yiwuyishi Network Technology Co ltd
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 Shenzhen Yiwuyishi Network Technology Co ltd filed Critical Shenzhen Yiwuyishi Network Technology Co ltd
Priority to CN201410405493.7A priority Critical patent/CN104156451A/en
Publication of CN104156451A publication Critical patent/CN104156451A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices

Abstract

The invention belongs to the technical field of data storage and provides a data storage managing method and system. The method comprises the steps of generating a database file according to data to be encrypted, wherein the database file contains header information and a data area, the header information contains an ID number, data length information and a two-byte random number for identifying the database file uniquely, and the data to be encrypted are saved in the data area after being encrypted according to the encryption algorithm; allocating a filename to the database file and saving the data in any storage device in the form of a file. By the adoption of the data storage managing method and system, a data storage managing scheme is provided for a small software system, the data to be encrypted are encrypted and saved in the form of the database file, the method is compatible with any operation system which has the file storage function, installation and configuration of database software are not needed, learning and using difficulty is reduced, and data connection and data interaction between different system platforms can be achieved.

Description

Data storage and management method and system
Technical field
The invention belongs to technical field of data processing, relate in particular to a kind of data storage and management method and system.
Background technology
Four large database concept softwares of current main-stream (SQL Server, Oracle, Sybase ASE, DB2), and conventional MySQL database, have following shortcoming: (one) needs professional installation and configuration; (2) computer system is had to certain requirement; (3) software development, more intense for the interface dependence with database, for software developer's database operation technology, need requirements at the higher level; (4) development of current network technology, data are kept at the Database Systems the inside of third party's exploitation, and there is potential threat in data security; (5) above database is not supported or supports not in place for mini-systems such as mobile terminal mobile phones.
Because the database software of above-mentioned main flow exists problems, the data that are all not suitable for some Small Scale Softwares are preserved, and particularly, for internal memory and the more nervous mobile device of flash memory, cannot use above-mentioned Sybase; Even if select one of them, supporting database is installed also can increase very burden to user; For the data of some high securities, had better not select third-party Database Systems in addition.
Summary of the invention
The object of the invention is to overcome above-mentioned the deficiencies in the prior art, a kind of data storage and management method and system are provided.
The present invention is achieved in that described data storage and management method, comprising:
According to be-encrypted data generated data library file, described database file comprises header and data field, described header comprises that described be-encrypted data is saved to described data field after encrypting according to cryptographic algorithm for No. ID of unique identification data library file, data length information, two byte random numbers;
To described database file allocate file name, with document form, be saved on any memory device.
Described data storage management system, turnkey is drawn together:
File generating unit, be used for according to be-encrypted data generated data library file, described database file comprises header and data field, described header comprises that described be-encrypted data is saved to described data field after encrypting according to cryptographic algorithm for No. ID of unique identification data library file, data length information, two byte random numbers;
File storage unit, for to described database file allocate file name, is saved on any memory device with document form.
The invention has the beneficial effects as follows: the present invention provides a set of data storage management scheme for Small Scale Software system, form with database file is encrypted storage to be-encrypted data, can support Windows, Linux, Andriod, the operating system of any supporting document storage such as iOS, to device hardware, require lower, without installing and configuration data library software, reduce study and used difficulty, can realize data docking and the data interaction of different system platform; In addition, data encryption adopts own algorithm, and data storage security is high.
Accompanying drawing explanation
In order to be illustrated more clearly in technical scheme of the present invention, to the accompanying drawing of required use in embodiment be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the process flow diagram of the data storage and management method that provides of first embodiment of the invention;
Fig. 2 is cryptographic algorithm process flow diagram;
Fig. 3 is decipherment algorithm process flow diagram;
Fig. 4 is database file distribution plan;
Fig. 5 is the block diagram of the data storage management system that provides of second embodiment of the invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described.
embodiment mono-:
As shown in Figure 1, the data storage and management method that the embodiment of the present invention provides comprises the steps:
Step S101, according to be-encrypted data generated data library file, described database file comprises header and data field, described header comprises that described be-encrypted data is saved to described data field after encrypting according to cryptographic algorithm for No. ID of unique identification data library file, data length information, two byte random numbers.
This step mainly completes according to predetermined format generated data library file, and database file comprises header and data field, and wherein, header comprises No. ID of unique identification data library file, data length information, two byte random numbers.
During specific implementation, first to be-encrypted data C distribute one No. ID, suppose that this has 4 bytes for No. ID; Then calculate the data length information of be-encrypted data, tentation data length has 4 bytes, and size that can identification document is 0~4G; Then produce two random numbers, be respectively the first random number A and the second random number B; Then by described two random numbers, be-encrypted data is encrypted to computing and obtains enciphered data, and cover former be-encrypted data C; Finally preserve described No. ID, data length information, enciphered data, form database file.Here limit the arrangement position of each part mentioned above in database file.
As a kind of concrete cryptographic algorithm, as shown in Figure 2, comprise the steps:
S201, by the odd bits of the first random number XOR be-encrypted data and cover and replace.Use the odd bits of the first random number A and the odd bits of be-encrypted data C corresponding XOR one by one, the result obtaining is replaced the corresponding odd bits of be-encrypted data C.
S202, with the even number of the second random number XOR be-encrypted data, be and cover replacement.Use the even bit of the second random number B and the even bit of be-encrypted data C corresponding XOR one by one, the result obtaining is replaced the corresponding even bit of be-encrypted data C.
S203, by the first random number, be multiplied by 3 and add the second random number, obtain without symbol-byte data D, and remove and surpass 1 byte part.Be D=A*3+B, only retain a rear byte of D.
S204, by described without the equal capped be-encrypted data of replacing of symbol-byte data XOR parity bit, directly preserve and obtain enciphered data.With the D be-encrypted data C that XOR is processed through step S201, S202 by turn, and corresponding covering replaces and preserves, and obtains final enciphered data.
In this step, as a kind of instantiation, it is as follows that described the first random number generates formula: (current time number of seconds * 7 * 13) %255; It is as follows that described the second random number generates formula: (current time number of seconds * 11 * 23) %255).
Step S102, to described database file allocate file name, with document form, be saved on any memory device.
After generated data library file, by regular allocation filename, preferably, described filename contains current date information, such as with filename _ days sky mode preserve, for example data_20140716.dbs, is then stored in database file on any storable equipment, such as mobile terminal with document form.
After completing data preservation, if desired the data in reading out data library file, need to carry out data deciphering, and as shown in Figure 3, decryption step is as follows:
S301, when needing data decryption library file, by the first random number, be multiplied by 3 and add the second random number and obtain without symbol-byte data, and remove and surpass 1 byte part. with A, be multiplied by 3 and add B, obtain without symbol-byte data D, be D=A*3+B, a byte part after then only retaining.
S302, with described without all enciphered datas in symbol-byte data step-by-step xor data library file, and cover to replace.With D by turn with enciphered data XOR, the corresponding Substitution encryption data of operation result.
S303, by the odd bits of described the first random number XOR enciphered data and cover and replace.Use the first odd bits of random number A and the odd bits of enciphered data corresponding XOR one by one, the corresponding odd bits of the result Substitution encryption data that obtain.
S304, with the even bit of described the second random number XOR enciphered data and cover and replace, the data after being deciphered.Use the second even bit of random number B and the even bit of enciphered data corresponding XOR one by one, the corresponding even bit of the result Substitution encryption data that obtain.So just can reduce and obtain clear data.
Be further used as a kind of preferred implementation, described header also comprises version number and proof test value district.Described version number is 2 bytes, and described proof test value district is 4 bytes, and concrete database file distributes as shown in Figure 4.By marked version this shop, so that database file can backup updating.After the every backup of described database file once, version number adds 1 automatically.Version number's content is that Database Shi Gai version number is 0 without symbol short (short type) data, later every backup once, this data accumulation 1, when reaching 65535, these data revert to 0.Concrete, according to data frequency of utilization and severity level, can be divided into by the hour, several back mechanisms such as sky, week, the moon, take below and carry out standard by sky backup as example: database file naming method as: filename _ days sky (such as: data_20140716.dbs), every mistake one day, need to back up the database file of the previous day, then save as new filename (such as data_20140717.dbs), the version information at the 10th byte place of database file adds up 1 simultaneously, is about to version number cumulative 1.With this kind of mechanism, back up, each month or one week needs compress filing backup file.When data are recovered, by name, search forward, if version cannot find before, pressure regulation contracting shelves are searched.
Described proof test value district is used for storing proof test value.In step S204, obtain after enciphered data, all enciphered datas are carried out to verification calculating according to pre-defined algorithm, such as passing through CRC check algorithm, obtain proof test value and be saved to described proof test value district, then No. ID, data length information, version number, proof test value, enciphered data are formed to database file.Wherein, header has 16 bytes.When without verification, the data in described proof test value district are the preset value that is different from proof test value.Such as being arranged to byte character string " NCRC ".
While opening database file, first carry out verification checking at every turn, when verification makes mistakes, according to current version number, read the database file of last revision, read enciphered data, then, according to decipherment algorithm deciphering, reduction obtains expressly.
embodiment bis-:
The embodiment of the present invention also provides a kind of data storage management system, as shown in Figure 5, comprising:
File generating unit 51, be used for according to be-encrypted data generated data library file, described database file comprises header and data field, described header comprises that described be-encrypted data is saved to described data field after encrypting according to cryptographic algorithm for No. ID of unique identification data library file, data length information, two byte random numbers;
File storage unit 52, for to described database file allocate file name, is saved on any memory device with document form.
Step S101, the S102 in embodiment mono-realized respectively in above-mentioned functions unit 51,52, can generated data library file by file generating unit 51, then by file storage unit 52, will after database file name, with document form, be saved on any memory device.
Preferably, described file generating unit 51 comprises:
Numbering distribution module, for be-encrypted data is distributed one No. ID;
Length computation module, for calculating the data length information of be-encrypted data;
Random number generation module, for generation of two random numbers, is respectively the first random number and the second random number; Preferably, described the first random number generation formula is as follows: (current time number of seconds * 7 * 13) %255; It is as follows that described the second random number generates formula: (current time number of seconds * 11 * 23) %255).
Encrypting module, obtains enciphered data for be-encrypted data being encrypted to computing by described two random numbers, and covers former be-encrypted data;
File generating module, for preserving described No. ID, data length information, enciphered data, forms database file.
Preferably, described encrypting module comprises:
The first encrypted component, replaces for the odd bits by the first random number XOR be-encrypted data covering;
The second encrypted component, is and covers replacement for the even number by the second random number XOR be-encrypted data;
The 3rd encrypted component, adds the second random number for being multiplied by 3 by the first random number, obtains without symbol-byte data, and removes over 1 byte part;
The 4th encrypted component, for being all capped the be-encrypted data of replacing by described without symbol-byte data XOR parity bit, directly preserves and obtains enciphered data.
In addition, notebook data storage management system also comprises document reading unit, for reading out data library file.Described document reading unit comprises deciphering module, and described deciphering module specifically comprises:
The first decryption component, adds the second random number and obtains without symbol-byte data for be multiplied by 3 by the first random number, and removes and surpass 1 byte part;
The second decryption component, for by described all enciphered datas without symbol-byte data step-by-step xor data library file, and covers and replaces;
The 3rd decryption component, replaces for the odd bits by described the first random number XOR enciphered data covering;
The 4th decryption component, replaces the data after being deciphered for the even bit by described the second random number XOR enciphered data covering.
As a kind of preferred implementation, described header also comprises version number and proof test value district, and described file generating unit 51 also comprises:
Version updating module, adds 1 automatically for version number after the every backup once of database file;
Correction verification module, for after obtaining enciphered data, carries out verification calculating to all enciphered datas according to pre-defined algorithm, obtains proof test value and is saved to described proof test value district.When without verification, the data in described proof test value district are the preset value that is different from proof test value.
Corresponding, described reading out data library file, except comprising deciphering module, also comprises:
Authentication module, during for needs data decryption library file, first carries out verification checking, when verification makes mistakes, according to current version number, reads the database file of last revision; Then deciphering module is deciphered according to decipherment algorithm, and reduction obtains expressly.
The above is the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications are also considered as protection scope of the present invention.

Claims (10)

1. a data storage and management method, is characterized in that, described method comprises:
According to be-encrypted data generated data library file, described database file comprises header and data field, described header comprises that described be-encrypted data is saved to described data field after encrypting according to cryptographic algorithm for No. ID of unique identification data library file, data length information, two byte random numbers;
To described database file allocate file name, with document form, be saved on any memory device.
2. data storage and management method according to claim 1, is characterized in that, described be-encrypted data generated data library file step specifically comprises:
To be-encrypted data distribute one No. ID;
Calculate the data length information of be-encrypted data;
Produce two random numbers, be respectively the first random number and the second random number;
By described two random numbers, be-encrypted data is encrypted to computing and obtains enciphered data, and cover former be-encrypted data;
Preserve described No. ID, data length information, enciphered data, form database file.
3. data storage and management method according to claim 2, is characterized in that, describedly by described two random numbers, be-encrypted data is encrypted to computing and obtains enciphered data step, specifically comprises:
With odd bits the covering of the first random number XOR be-encrypted data, replace;
With the even number of the second random number XOR be-encrypted data, be and cover replacement;
By the first random number, be multiplied by 3 and add the second random number, obtain without symbol-byte data, and remove over 1 byte part;
By described, without symbol-byte data XOR parity bit, be all capped the be-encrypted data of replacing, directly preserve and obtain enciphered data.
4. data storage and management method according to claim 3, is characterized in that, it is as follows that described the first random number generates formula: (current time number of seconds * 7 * 13) %255; It is as follows that described the second random number generates formula: (current time number of seconds * 11 * 23) %255).
5. according to right, want the data storage and management method described in 4, it is characterized in that, described method also comprises the steps:
When needing data decryption library file, by the first random number, be multiplied by 3 and add the second random number and obtain without symbol-byte data, and remove and surpass 1 byte part;
With described, without all enciphered datas in symbol-byte data step-by-step xor data library file, and cover to replace;
With odd bits the covering of described the first random number XOR enciphered data, replace;
With even bit the covering of described the second random number XOR enciphered data, replace the data after being deciphered.
6. according to the data storage and management method described in claim 2-5 any one, it is characterized in that, described header also comprises version number and proof test value district; After the every backup of described database file once, version number adds 1 automatically; After obtaining enciphered data, all enciphered datas are carried out to verification calculating according to pre-defined algorithm, obtain proof test value and be saved to described proof test value district; When needs data decryption library file, first carry out verification checking, when verification makes mistakes, according to current version number, read the database file of last revision, then, according to decipherment algorithm deciphering, reduction obtains expressly.
7. data storage and management method according to claim 6, is characterized in that, when without verification, the data in described proof test value district are the preset value that is different from proof test value.
8. a data storage management system, is characterized in that, described system comprises:
File generating unit, be used for according to be-encrypted data generated data library file, described database file comprises header and data field, described header comprises that described be-encrypted data is saved to described data field after encrypting according to cryptographic algorithm for No. ID of unique identification data library file, data length information, two byte random numbers;
File storage unit, for to described database file allocate file name, is saved on any memory device with document form.
9. data storage management system as claimed in claim 8, is characterized in that, described file generating unit comprises:
Numbering distribution module, for be-encrypted data is distributed one No. ID;
Length computation module, for calculating the data length information of be-encrypted data;
Random number generation module, for generation of two random numbers, is respectively the first random number and the second random number;
Encrypting module, obtains enciphered data for be-encrypted data being encrypted to computing by described two random numbers, and covers former be-encrypted data;
File generating module, for preserving described No. ID, data length information, enciphered data, forms database file.
10. data storage management system as claimed in claim 9, is characterized in that, described encrypting module comprises:
The first encrypted component, replaces for the odd bits by the first random number XOR be-encrypted data covering;
The second encrypted component, is and covers replacement for the even number by the second random number XOR be-encrypted data;
The 3rd encrypted component, adds the second random number for being multiplied by 3 by the first random number, obtains without symbol-byte data, and removes over 1 byte part;
The 4th encrypted component, for being all capped the be-encrypted data of replacing by described without symbol-byte data XOR parity bit, directly preserves and obtains enciphered data.
CN201410405493.7A 2014-08-18 2014-08-18 Data storage managing method and system Pending CN104156451A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410405493.7A CN104156451A (en) 2014-08-18 2014-08-18 Data storage managing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410405493.7A CN104156451A (en) 2014-08-18 2014-08-18 Data storage managing method and system

Publications (1)

Publication Number Publication Date
CN104156451A true CN104156451A (en) 2014-11-19

Family

ID=51881949

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410405493.7A Pending CN104156451A (en) 2014-08-18 2014-08-18 Data storage managing method and system

Country Status (1)

Country Link
CN (1) CN104156451A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104636444A (en) * 2015-01-13 2015-05-20 大唐移动通信设备有限公司 Database encryption and decryption method and device
CN104699779A (en) * 2015-03-11 2015-06-10 北京京东尚科信息技术有限公司 Object number generating method and device
CN104809175A (en) * 2015-04-13 2015-07-29 上海达梦数据库有限公司 Generation method and device of feature library
CN105701408A (en) * 2015-12-31 2016-06-22 深圳市证通电子股份有限公司 FatFs based encrypted file system and implementation method thereof
CN106850191A (en) * 2017-02-19 2017-06-13 郑州云海信息技术有限公司 The encryption and decryption method and device of distributed memory system communication protocol
CN108255938A (en) * 2017-12-07 2018-07-06 中国航空工业集团公司西安航空计算技术研究所 A kind of airborne Embedded Main Memory Database image generation and loading method
CN108848070A (en) * 2018-05-30 2018-11-20 郑州云海信息技术有限公司 A kind of identity identifying method and system
CN111723383A (en) * 2019-03-22 2020-09-29 阿里巴巴集团控股有限公司 Data storage and verification method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040086127A1 (en) * 2002-11-05 2004-05-06 Candelore Brant L. Mechanism for protecting the transfer of digital content
CN1711514A (en) * 2002-11-15 2005-12-21 皇家飞利浦电子股份有限公司 Archive system and method for copy controlled storage devices
CN1932810A (en) * 2005-09-13 2007-03-21 李晓耕 Method for storing and sharing data utilizing encrypted technology

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040086127A1 (en) * 2002-11-05 2004-05-06 Candelore Brant L. Mechanism for protecting the transfer of digital content
CN1711514A (en) * 2002-11-15 2005-12-21 皇家飞利浦电子股份有限公司 Archive system and method for copy controlled storage devices
CN1932810A (en) * 2005-09-13 2007-03-21 李晓耕 Method for storing and sharing data utilizing encrypted technology

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
叶晰等: "基于MD5算法的动态口令技术的软件实现", 《计算机应用与软件》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104636444A (en) * 2015-01-13 2015-05-20 大唐移动通信设备有限公司 Database encryption and decryption method and device
CN104636444B (en) * 2015-01-13 2018-12-18 大唐移动通信设备有限公司 A kind of encryption and decryption method and device of database
CN104699779A (en) * 2015-03-11 2015-06-10 北京京东尚科信息技术有限公司 Object number generating method and device
CN104809175A (en) * 2015-04-13 2015-07-29 上海达梦数据库有限公司 Generation method and device of feature library
CN104809175B (en) * 2015-04-13 2018-02-27 上海达梦数据库有限公司 The generation method and device of feature database
CN105701408A (en) * 2015-12-31 2016-06-22 深圳市证通电子股份有限公司 FatFs based encrypted file system and implementation method thereof
CN106850191A (en) * 2017-02-19 2017-06-13 郑州云海信息技术有限公司 The encryption and decryption method and device of distributed memory system communication protocol
CN108255938A (en) * 2017-12-07 2018-07-06 中国航空工业集团公司西安航空计算技术研究所 A kind of airborne Embedded Main Memory Database image generation and loading method
CN108848070A (en) * 2018-05-30 2018-11-20 郑州云海信息技术有限公司 A kind of identity identifying method and system
CN111723383A (en) * 2019-03-22 2020-09-29 阿里巴巴集团控股有限公司 Data storage and verification method and device
WO2020192406A1 (en) * 2019-03-22 2020-10-01 阿里巴巴集团控股有限公司 Method and apparatus for data storage and verification
CN111723383B (en) * 2019-03-22 2024-03-19 阿里巴巴集团控股有限公司 Data storage and verification method and device

Similar Documents

Publication Publication Date Title
CN104156451A (en) Data storage managing method and system
US10778441B2 (en) Redactable document signatures
CN106778283B (en) Method and system for protecting key data of system partition
CN106971121B (en) Data processing method, device, server and storage medium
US20220198052A1 (en) Data storage method, device, and storage medium
US11704420B2 (en) Terminal device and computer program
CN106161336A (en) A kind of information updating method, Apparatus and system
CN105468990A (en) Sensitive information management control method and apparatus
EP3667542A1 (en) Self-encryption drive (sed)
CN104636444B (en) A kind of encryption and decryption method and device of database
CN103729470A (en) Secure storage method based on different cloud storage ends
US20150227753A1 (en) Content item encryption on mobile devices
CN104517061A (en) Method for encrypting file system and method for mounting encrypted file system
CN111008034B (en) Patch generation method and device
US20170124353A1 (en) Method And Apparatus For Preventing Rollback Of Secure Data
US8898807B2 (en) Data protecting method, mobile communication device, and memory storage device
CN103166911A (en) Version management server authority management method and version management server authority management equipment
CN105279198A (en) Data table storage method, data table modification method, data table query method and data table statistical method
US20230153292A1 (en) Ensuring consistent metadata across computing devices
CN110807205B (en) File security protection method and device
CN111382458A (en) Data batch sealing method and device and computer storage medium
US10949537B2 (en) Secure firmware provisioning and device binding mechanism
CN103679045A (en) File security control system and method
CN111400771A (en) Target partition checking method and device, storage medium and computer equipment
CN109598137B (en) Method and system for safely processing data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned

Effective date of abandoning: 20180309

AD01 Patent right deemed abandoned