CN110535642B - Method for distributing storage keys, intelligent terminal and storage medium - Google Patents

Method for distributing storage keys, intelligent terminal and storage medium Download PDF

Info

Publication number
CN110535642B
CN110535642B CN201910822954.3A CN201910822954A CN110535642B CN 110535642 B CN110535642 B CN 110535642B CN 201910822954 A CN201910822954 A CN 201910822954A CN 110535642 B CN110535642 B CN 110535642B
Authority
CN
China
Prior art keywords
data
file
data block
key
hash value
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.)
Active
Application number
CN201910822954.3A
Other languages
Chinese (zh)
Other versions
CN110535642A (en
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.)
Beijing Zhiyou Wang'an Technology Co ltd
Original Assignee
Beijing Zhiyou Wang'an 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 Beijing Zhiyou Wang'an Technology Co ltd filed Critical Beijing Zhiyou Wang'an Technology Co ltd
Priority to CN201910822954.3A priority Critical patent/CN110535642B/en
Publication of CN110535642A publication Critical patent/CN110535642A/en
Application granted granted Critical
Publication of CN110535642B publication Critical patent/CN110535642B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/085Secret sharing or secret splitting, e.g. threshold schemes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0894Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage

Abstract

The invention discloses a method for dispersing storage keys, an intelligent terminal and a storage medium, wherein the method comprises the following steps: dynamically and randomly generating a plurality of modules for dispersedly storing keys; dynamically compiling a plurality of modules, packaging and storing; in the process of processing the user APP, dividing the secret key into a plurality of data blocks for scattered storage; and in operation, combining the data blocks to generate a complete key. The invention enhances the security of the algorithm key, enables the key to be more safely stored in a plurality of resource and code modules, performs real-time combined use in the dynamic operation process, ensures that the key is dispersedly stored in a plurality of places in a static state and is stored in scattered data blocks, and combines the data blocks to generate a final key in the final operation process, thereby achieving the purpose of ensuring the safe storage of the key.

Description

Method for distributing storage keys, intelligent terminal and storage medium
Technical Field
The invention relates to the technical field of computer application, in particular to a method for storing keys in a distributed mode, an intelligent terminal and a storage medium.
Background
At present, Android APP is more and more common in life, and functions of the Android application are more and more, wherein various sensitive information such as funds, personal information and privacy technology is not lacked.
Generally, the method for ensuring the security of the information is to encrypt the information by using an algorithm, and the security of the algorithm is generally guaranteed, such as a national cryptographic algorithm series (SM algorithm, which is a series of algorithms specified by the national cryptology authority), an international general algorithm series (AES, etc., issued by the security agency of the united states and is the most common commercial algorithm nowadays); however, the algorithm has another important security parameter, namely, a key of the algorithm, and the key is directly related to the overall security and can be said to be the most important parameter in the encryption process.
However, various storage means in the prior art are generally single, and the safety is not high; for example, the key is written directly in java code, which is least secure and easy to be directly obtained, and further written directly in C-layer code, but this method is also not sufficiently secure and can be simply obtained by software such as IDA.
Accordingly, the prior art is yet to be improved and developed.
Disclosure of Invention
The invention mainly aims to provide a method for dispersedly storing a secret key, an intelligent terminal and a storage medium, and aims to solve the problems that in the prior art, an encryption algorithm is low in safety and easy to reveal important information.
In order to achieve the above object, the present invention provides a method for distributing storage keys, which comprises the following steps:
dynamically and randomly generating a plurality of modules for dispersedly storing keys;
dynamically compiling a plurality of modules, packaging and storing;
in the process of processing the user APP, dividing the secret key into a plurality of data blocks for scattered storage;
and in operation, combining the data blocks to generate a complete key.
Optionally, the method for distributing a storage key, where the dynamically and randomly generating a plurality of modules for distributing a storage key specifically includes:
storing the random data combination A and the random index table B in a source code file, writing the random data combination A and the random index table B into a source file, and defining the random data combination A and the random index table B as a first module;
generating 32 random data combinations, randomly generating an index value C, writing the 32 random data combinations into the source file, and storing the index value C into java codes to define a second module;
randomly generating a string of data, calculating a hash value of the data, storing the hash value into the java code, and defining the hash value as a third module;
and randomly generating a resource file, storing the resource file in an APK resource directory, and defining the resource file as a fourth module.
Optionally, the method for storing keys in a distributed manner, where the dynamically compiling and packing the modules for storage specifically includes:
compiling the source file into a dynamic SO library;
compiling the java code into a DEX file;
and packaging the randomly generated resource file into an APK file.
Optionally, the method for storing a key in a distributed manner, where in the process of processing the APP of the user, dividing the key into a plurality of data blocks for distributed storage specifically includes:
acquiring an application APP packet name to form a first data block;
acquiring the random index table B from the dynamically compiled SO library, and acquiring corresponding data from the random data combination A according to the index to form a second data block;
acquiring the 32 random data combinations from the dynamically compiled SO library, acquiring the stored index value C from the DEX file of the java code, circularly calculating a hash value by removing the 31 data combinations except the index value C, and forming a third data block;
reading the stored hash value from the java code to form a fourth data block;
and reading the stored data from the resource file, and calculating a hash value to form a fifth data block.
Optionally, the method for storing a key dispersively, wherein the generating a complete key by combining a plurality of data blocks in the runtime specifically includes:
calculating a hash value according to the first data block, the second data block, the third data block, the fourth data block and the fifth data block, and generating a key character string;
and in dynamic operation, carrying out key combination on the first data block, the second data block, the third data block, the fourth data block and the fifth data block to generate a complete key.
Optionally, in the method for decentralized storage of a key, the first data block includes a unique APP packet name;
the key in the second data block is dispersedly stored in a C-layer code file and dynamically compiled into an SO file;
the data of the third data block is stored in the C-layer code file and is dynamically combined during operation;
randomly generating a string of data with the length of 256 bytes in the process, taking a hash value for the data, storing the hash value into the java code, compiling the hash value into a DEX file, and acquiring the hash value stored by the java code to obtain the fourth data block during operation;
in the process of processing the user APP, a piece of data with an unfixed length is randomly generated and then stored in the resource file below the assets resource directory, in the dynamic compiling process, the file is stored in the APK, in the operation stage, the resource file is read, and the hash value is taken from the data to obtain the fifth data block.
Optionally, the method for storing keys in a distributed manner, where the keys in the second data block are stored in a C-layer code file in a distributed manner and dynamically compiled into an SO file, specifically includes:
randomly generating a block of data content and randomly generating an index array table;
writing the data content and the index array table into a C code file;
and compiling the source code file into the dynamic SO library in the dynamic compiling process, calling the SO library in the running process to obtain the index number array table and the random block data, and obtaining real content from the random data block according to the index number array table to obtain the second data block.
Optionally, the method for storing keys dispersedly, wherein data of the third data block is stored in the C-layer code file, and is dynamically combined during runtime, specifically including:
randomly generating 32 groups of data blocks, wherein each group of data blocks is stored in the C-layer code file and compiled into an SO file;
randomly generating an index value within 32, storing the index value in the java code, and compiling the index value into a DEX file;
in the operation process, according to the index data stored by the java code, eliminating the indexed data block, circularly calculating the hash value of the remaining 31 data blocks, combining the hash value of the first data block with the hash value of the second data block to calculate the hash, combining the hash value with the hash value of the third data block to calculate the hash, and so on, finally obtaining a hash value to obtain the third data block.
In addition, to achieve the above object, the present invention further provides an intelligent terminal, wherein the intelligent terminal includes: a memory, a processor and a program of distributed storage keys stored on the memory and executable on the processor, the program of distributed storage keys implementing the steps of the method of distributed storage keys as described above when executed by the processor.
In addition, to achieve the above object, the present invention further provides a storage medium, wherein the storage medium stores a program for storing keys dispersively, and the program for storing keys dispersively realizes the steps of the method for storing keys dispersively as described above when executed by a processor.
In the invention, a plurality of modules for dispersedly storing the secret key are generated randomly by dynamic; dynamically compiling a plurality of modules, packaging and storing; in the process of processing the user APP, dividing the secret key into a plurality of data blocks for scattered storage; and when the data block is operated, combining the data blocks to generate a complete key. The invention enhances the security of the algorithm key, enables the key to be more safely stored in a plurality of resource and code modules, carries out real-time combined use in the dynamic operation process, ensures that the key is dispersedly stored in a plurality of places in a static state and stores scattered data blocks, and finally combines the data blocks to generate the final key in the final operation process, thereby achieving the purpose of ensuring the safe storage of the key.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of a method for decentralized storage of keys according to the present invention;
fig. 2 is a schematic operating environment diagram of an intelligent terminal according to a preferred embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
As shown in fig. 1, the method for storing keys dispersedly includes the following steps:
step S10, dynamically and randomly generating a plurality of modules for dispersedly storing the key.
Specifically, the random data combination a and the random index table B are stored in a source code file and written into a source file (encRandom buffer.h), which is defined as a first module; generating 32 random data combinations, randomly generating an index value C, writing the 32 random data combinations into the source file, and storing the index value C into java codes to define a second module; randomly generating a string of data, calculating a hash value of the data (the hash value is also called a hash function or a hash algorithm, also called a hash function, and is a method for creating a small digital fingerprint from any kind of data, the hash function compresses a message or data into a summary so that the data volume becomes small and the format of the data is fixed), and storing the data into the java code to define a third module; randomly generating a resource file, storing the resource file in an APK (Android package) resource directory, and defining the resource file as a fourth module.
And step S20, dynamically compiling the modules, packaging and storing.
Specifically, the source file is compiled into a dynamic SO library; compiling the java code into a DEX file; and packaging the randomly generated resource file into an APK file.
The DEX is an executable file on an Android platform (Dalvik virtual machine), and is equivalent to an exe file in a Windows platform, each APK installation package has the DEX file, all source codes of the APP are contained in each APK installation package, and the corresponding java source codes can be obtained through a decompiling tool.
Because the java source code can be directly seen through decompiling the DEX file, more and more APPs (including malicious virus APPs) use the reinforcement technology to prevent the APPs from being easily decompiled, when the reinforced malicious virus APP needs to be analyzed or cracked, the format of the DEX file needs to be known, and the reinforced DEX file is restored (unshelled) and then decompiled to obtain the java source code.
Step S30, in the process of processing the user APP, dividing the key into a plurality of data blocks for distributed storage.
Specifically, an application APP packet name is obtained to form a first data block; acquiring the random index table B from the dynamically compiled SO library, and acquiring corresponding data from the random data combination A according to the index to form a second data block; acquiring the 32 random data combinations from the dynamically compiled SO library, acquiring the stored index value C from the DEX file of the java code, removing 31 data combinations except the index value C, and circularly calculating a hash value to form a third data block; reading the stored hash value from the java code to form a fourth data block; and reading the stored data from the resource file, and calculating a hash value to form a fifth data block.
Wherein the first data block: and dynamically and directly acquiring the APP packet name of the user, wherein the packet name has uniqueness in the Android application, and the packet name is used as the data in the first data block.
The second data block: the secret key is stored in a C-layer code file in a scattered manner and is dynamically compiled into an SO file; firstly, a piece of data content is randomly generated by a platform, and then an index number group table (the index number group table is index data for the position number of the previous data, for example, 1024 data contents are generated in the previous table, and the index for randomly selecting a plurality of data is performed between 0 and 1024) is randomly generated by the platform, and the length of the group of data is also required to be randomly generated and is smaller than the length of the previous data content; then writing the data content and the index array table into a C code header file for subsequent calling; and then, the source code file is compiled into a dynamic SO library in the dynamic compiling process, the SO dynamic library is called in the running process to obtain an array index table and random block data, and then the real content is obtained from the random data block according to the index array table to obtain the final data of a second data block.
The specific acquisition rule is as follows: assuming that the index array table stores 0x01, it represents that it is necessary to read the 0x01 th data … … inside the random data block, and so on.
The third data block: the technical principle of the part of data is similar to that of the second data block part, a dynamic compiling technology is also adopted, key data are stored in a C-layer code module and are dynamically combined during running, but the technology combined with Java layer code is used in processing, and the method specifically comprises the following steps: the platform randomly generates 32 groups of data blocks, the data blocks are stored in the C layer code and compiled into SO files, and in addition, an index value within 32 is randomly generated, stored in the Java layer code and then compiled into DEX files; in the operation process, firstly, according to index data stored in Java layer codes, eliminating data blocks of the index, circularly calculating the hash value of the rest 31 data blocks, combining the hash value of the first data block and the hash value of the second data block to calculate the hash, then combining the hash value of the first data block and the hash value of the second data block to calculate the hash, and so on, and finally obtaining a hash value as the data of the third data block.
The fourth data block: in the process of operation, a string of data with the length of 256 bytes is randomly generated, a hash value is taken from the data, then the hash value is stored in a Java code, and the Java code is compiled into a DEX file in a dynamic compiling module; and during operation, a hash value stored in the Java layer code is acquired to obtain the data of the fourth data block.
The fifth data block: in the process of processing the user APP, a piece of data with an unfixed length is randomly generated and then stored in the png file below the assets resource directory, and in the dynamic compiling process, the file is stored in the APK; in the operation stage, the resource file is read first, and then the hash value is taken from the data to obtain the data of the fifth data block.
And step S40, combining the data blocks to generate a complete key when running.
Specifically, a hash value is calculated according to the first data block, the second data block, the third data block, the fourth data block and the fifth data block, and a key character string is generated; and in dynamic operation, carrying out key combination on the first data block, the second data block, the third data block, the fourth data block and the fifth data block to generate a complete key.
The SM4 block cipher algorithm secret key length is 128bit, the secret key is stored by adopting the idea of distributed storage, and finally the secret key is dynamically compiled to generate an algorithm SO file, meanwhile, partial secret keys are randomly generated in a Java code layer and an APP resource file, and finally the secret keys at the positions are combined to generate a final algorithm secret key.
The invention aims to enhance the safety of an algorithm key, so that the key is more safely stored in a plurality of modules such as resources, codes and the like, the key is dispersedly stored in a plurality of places in a static state when being combined and used in a real-time manner in the dynamic operation process, and a plurality of scattered data blocks are stored, and the data blocks are combined to generate a final key in the final operation process, thereby achieving the function of ensuring the safe storage of the key.
Further, as shown in fig. 2, based on the above method for storing keys dispersedly, the present invention also provides an intelligent terminal, where the intelligent terminal includes: a processor 10, a memory 20, and a display 30. Fig. 2 shows only some of the components of the smart terminal, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
The memory 20 may be an internal storage unit of the intelligent terminal in some embodiments, such as a hard disk or a memory of the intelligent terminal. The memory 20 may also be an external storage device of the Smart terminal in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the Smart terminal. Further, the memory 20 may also include both an internal storage unit and an external storage device of the smart terminal. The memory 20 is used for storing application software installed in the intelligent terminal and various data, such as program codes of the installed intelligent terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 stores a program 40 for distributing storage keys, and the program 40 for distributing storage keys is executable by the processor 10, so as to implement the method for distributing storage keys in the present application.
The processor 10 may be a Central Processing Unit (CPU), a microprocessor or other data Processing chip in some embodiments, and is used for executing program codes stored in the memory 20 or Processing data, such as executing the method for storing the distributed memory key.
The display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch panel, or the like in some embodiments. The display 30 is used for displaying information at the intelligent terminal and for displaying a visual user interface. The components 10-30 of the intelligent terminal communicate with each other via a system bus.
In one embodiment, when the processor 10 executes the program 40 for dispersedly storing the secret key in the memory 20, the following steps are implemented:
dynamically and randomly generating a plurality of modules for dispersedly storing keys;
dynamically compiling a plurality of modules, and packaging and storing the modules;
in the process of processing the user APP, dividing the secret key into a plurality of data blocks for scattered storage;
and in operation, combining the data blocks to generate a complete key.
The dynamic random generation of a plurality of modules for scattered storage of keys specifically comprises:
storing the random data combination A and the random index table B in a source code file, writing the random data combination A and the random index table B into a source file, and defining the random data combination A and the random index table B as a first module;
generating 32 random data combinations, randomly generating an index value C, writing the 32 random data combinations into the source file, and storing the index value C into java codes to define a second module;
randomly generating a string of data, calculating a hash value of the data, storing the hash value into the java code, and defining the hash value as a third module;
and randomly generating a resource file, storing the resource file in an APK resource directory, and defining the resource file as a fourth module.
The dynamically compiling and packing the modules for storage specifically comprises the following steps:
compiling the source file into a dynamic SO library;
compiling the java code into a DEX file;
and packaging the randomly generated resource file into an APK file.
In the process of processing the user APP, dividing the key into a plurality of data blocks for dispersed storage, and specifically including:
acquiring an application APP packet name to form a first data block;
acquiring the random index table B from the dynamically compiled SO library, and acquiring corresponding data from the random data combination A according to the index to form a second data block;
acquiring the 32 random data combinations from the dynamically compiled SO library, acquiring the stored index value C from the DEX file of the java code, removing 31 data combinations except the index value C, and circularly calculating a hash value to form a third data block;
reading the stored hash value from the java code to form a fourth data block;
and reading the stored data from the resource file, and calculating a hash value to form a fifth data block.
In the running process, the combining the multiple data blocks to generate a complete key specifically includes:
calculating a hash value according to the first data block, the second data block, the third data block, the fourth data block and the fifth data block, and generating a key character string;
and in dynamic operation, carrying out key combination on the first data block, the second data block, the third data block, the fourth data block and the fifth data block to generate a complete key.
The first data block contains a unique APP packet name;
the key in the second data block is dispersedly stored in a C-layer code file and dynamically compiled into an SO file;
the data of the third data block is stored in the C-layer code file and is dynamically combined during operation;
randomly generating a string of data with the length of 256 bytes in the process, taking a hash value for the data, storing the hash value into the java code, compiling the hash value into a DEX file, and acquiring the hash value stored by the java code to obtain the fourth data block during operation;
in the process of processing the user APP, a piece of data with an unfixed length is randomly generated and then stored in the resource file below the assets resource directory, in the dynamic compiling process, the file is stored in the APK, in the operation stage, the resource file is read, and the hash value is taken from the data to obtain the fifth data block.
The keys in the second data block are dispersedly stored in a C-layer code file and dynamically compiled into an SO file, and the method specifically includes:
randomly generating a block of data content and randomly generating an index array table;
writing the data content and the index array table into a C code file;
and compiling a source code file into the dynamic SO library in the dynamic compiling process, calling the SO library in the running process to obtain the index number array table and random block data, and obtaining real content from the random data block according to the index number array table to obtain the second data block.
The data of the third data block is stored in the C-layer code file, and is dynamically combined during runtime, which specifically includes:
randomly generating 32 groups of data blocks, wherein each group of data blocks is stored in the C-layer code file and compiled into an SO file;
randomly generating an index value within 32, storing the index value in the java code, and compiling the index value into a DEX file;
in the operation process, according to the index data stored by the java code, the indexed data block is excluded, the hash value of the remaining 31 data blocks is circularly calculated, the hash of the first block data and the hash value of the second block data are combined to calculate the hash, the hash value is combined with the hash of the third block data to calculate the hash, and so on, and finally a hash value is obtained to obtain the third data block.
Further, the present invention also provides a storage medium, wherein the storage medium stores a program for distributing storage keys, and the program for distributing storage keys implements the steps of the method for distributing storage keys as described above when being executed by a processor.
In summary, the present invention provides a method, an intelligent terminal, and a storage medium for storing keys in a distributed manner, where the method includes: dynamically and randomly generating a plurality of modules for dispersedly storing keys; dynamically compiling a plurality of modules, packaging and storing; in the process of processing the user APP, dividing the secret key into a plurality of data blocks for scattered storage; and in operation, combining the data blocks to generate a complete key. The invention enhances the security of the algorithm key, enables the key to be more safely stored in a plurality of resource and code modules, carries out real-time combined use in the dynamic operation process, ensures that the key is dispersedly stored in a plurality of places in a static state and stores scattered data blocks, and finally combines the data blocks to generate the final key in the final operation process, thereby achieving the purpose of ensuring the safe storage of the key.
Of course, it will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program instructing relevant hardware (such as a processor, a controller, etc.), and the program may be stored in a computer readable storage medium, and when executed, the program may include the processes of the above method embodiments. The storage medium may be a memory, a magnetic disk, an optical disk, etc.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (7)

1. A method for distributing storage keys, the method comprising:
dynamically and randomly generating a plurality of modules for dispersedly storing keys;
the dynamically and randomly generating a plurality of modules for dispersedly storing the key specifically comprises:
storing the random data combination A and the random index table B in a source code file, writing the random data combination A and the random index table B into a source file, and defining the random data combination A and the random index table B as a first module;
generating 32 random data combinations, randomly generating an index value C, writing the 32 random data combinations into the source file, storing the index value C into java codes, and defining the index value C as a second module;
randomly generating a string of data, calculating a hash value of the data, storing the hash value into the java code, and defining the hash value as a third module;
randomly generating a resource file, storing the resource file in an APK resource directory, and defining the resource file as a fourth module;
dynamically compiling a plurality of modules, packaging and storing;
the dynamically compiling and packing the modules for storage specifically comprises the following steps:
compiling the source file into a dynamic SO library;
compiling the java code into a DEX file;
packaging the randomly generated resource files into an APK file;
in the process of processing the user APP, dividing the secret key into a plurality of data blocks for scattered storage;
in the process of processing the user APP, dividing the key into a plurality of data blocks for dispersed storage, specifically including:
acquiring an application APP packet name to form a first data block;
acquiring the random index table B from the dynamically compiled SO library, and acquiring corresponding data from the random data combination A according to the index to form a second data block;
acquiring the 32 random data combinations from the dynamically compiled SO library, acquiring the stored index value C from the DEX file of the java code, circularly calculating a hash value by removing the 31 data combinations except the index value C, and forming a third data block;
reading the stored hash value from the java code to form a fourth data block;
reading the stored data from the resource file, and calculating a hash value to form a fifth data block;
and when the data block is operated, combining the data blocks to generate a complete key.
2. The method for storing keys dispersedly as claimed in claim 1, wherein the generating, by the runtime, a plurality of the data blocks is combined to generate a complete key, specifically comprising:
calculating a hash value according to the first data block, the second data block, the third data block, the fourth data block and the fifth data block, and generating a key character string;
and in dynamic operation, the first data block, the second data block, the third data block, the fourth data block and the fifth data block are subjected to key combination to generate a complete key.
3. The method for decentralized storage of keys according to claim 1, wherein said first data block contains a unique APP package name;
the key in the second data block is dispersedly stored in a C-layer code file and dynamically compiled into an SO file;
the data of the third data block is stored in the C-layer code file and is dynamically combined during operation;
randomly generating a string of data with the length of 256 bytes in the process, taking a hash value for the data, storing the hash value into the java code, compiling the hash value into a DEX file, and acquiring the hash value stored by the java code to obtain the fourth data block during operation;
in the process of processing the user APP, a piece of data with an unfixed length is randomly generated and then stored in the resource file below the assets resource directory, in the dynamic compiling process, the file is stored in the APK, in the operation stage, the resource file is read, and the hash value is taken from the data to obtain the fifth data block.
4. The method for storing keys dispersedly according to claim 3, wherein the keys in the second data block are dispersedly saved in a C-layer code file and dynamically compiled in an SO file, and specifically comprises:
randomly generating a block of data content and randomly generating an index array table;
writing the data content and the index array table into a C code file;
and compiling the source code file into the dynamic SO library in the dynamic compiling process, calling the SO library in the running process to obtain the index number array table and the random block data, and obtaining real content from the random data block according to the index number array table to obtain the second data block.
5. The method for storing keys dispersedly as claimed in claim 3, wherein the data of the third data block is stored in the C-layer code file and dynamically combined during runtime, specifically comprising:
randomly generating 32 groups of data blocks, wherein each group of data blocks is stored in the C-layer code file and compiled into an SO file;
randomly generating an index value within 32, storing the index value in the java code, and compiling the index value into a DEX file;
in the operation process, according to the index data stored by the java code, the indexed data block is excluded, the hash value of the remaining 31 data blocks is circularly calculated, the hash of the first block data and the hash value of the second block data are combined to calculate the hash, the hash value is combined with the hash of the third block data to calculate the hash, and so on, and finally a hash value is obtained to obtain the third data block.
6. An intelligent terminal, characterized in that, intelligent terminal includes: memory, processor and program for decentralized storage of keys stored in the memory and executable on the processor, which program for decentralized storage of keys when executed by the processor implements the steps of the method for decentralized storage of keys according to any of claims 1 to 5.
7. A storage medium, characterized in that the storage medium stores a program for scattering a storage key, which when executed by a processor implements the steps of the method for scattering a storage key according to any one of claims 1 to 5.
CN201910822954.3A 2019-09-02 2019-09-02 Method for distributing storage keys, intelligent terminal and storage medium Active CN110535642B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910822954.3A CN110535642B (en) 2019-09-02 2019-09-02 Method for distributing storage keys, intelligent terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910822954.3A CN110535642B (en) 2019-09-02 2019-09-02 Method for distributing storage keys, intelligent terminal and storage medium

Publications (2)

Publication Number Publication Date
CN110535642A CN110535642A (en) 2019-12-03
CN110535642B true CN110535642B (en) 2022-09-13

Family

ID=68666110

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910822954.3A Active CN110535642B (en) 2019-09-02 2019-09-02 Method for distributing storage keys, intelligent terminal and storage medium

Country Status (1)

Country Link
CN (1) CN110535642B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116388980A (en) * 2020-03-17 2023-07-04 江苏恒宝智能系统技术有限公司 Android environment key segmentation processing method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708069A (en) * 2012-05-12 2012-10-03 北京深思洛克软件技术股份有限公司 Protection method for memory data in Android system
WO2017215148A1 (en) * 2016-06-17 2017-12-21 中兴通讯股份有限公司 File protection method and device
CN109657488A (en) * 2019-02-26 2019-04-19 北京智游网安科技有限公司 A kind of resource file cipher processing method, intelligent terminal and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101311942B (en) * 2007-05-23 2011-08-24 西门子(中国)有限公司 Software encryption and decryption method and encryption and decryption device
US8892908B2 (en) * 2010-12-23 2014-11-18 Morega Systems Inc. Cryptography module for use with fragmented key and methods for use therewith
US20140211944A1 (en) * 2012-09-24 2014-07-31 Daniel Joseph Lutz System and method of protecting, storing and decrypting keys over a computerized network
US10411907B2 (en) * 2017-01-25 2019-09-10 Salesforce.Com, Inc. Secure remote user authentication leveraging public key cryptography and key splitting
CN107294702B (en) * 2017-07-17 2020-04-28 四川长虹电器股份有限公司 Front-end code encryption method based on Hybrid APP self characteristics
CN108712412B (en) * 2018-05-15 2022-02-22 北京五八信息技术有限公司 Database encryption and decryption methods and devices, storage medium and terminal
CN109005196A (en) * 2018-09-10 2018-12-14 北京旷视科技有限公司 Data transmission method, data decryption method, device and electronic equipment
CN109495255A (en) * 2018-12-11 2019-03-19 中新金桥数字科技(北京)有限公司 Digital cryptographic key protection method and its system based on android system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708069A (en) * 2012-05-12 2012-10-03 北京深思洛克软件技术股份有限公司 Protection method for memory data in Android system
WO2017215148A1 (en) * 2016-06-17 2017-12-21 中兴通讯股份有限公司 File protection method and device
CN109657488A (en) * 2019-02-26 2019-04-19 北京智游网安科技有限公司 A kind of resource file cipher processing method, intelligent terminal and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Android数据安全存储平台的设计与实现;田伟等;《信息网络安全》;20150910(第09期);全文 *
基于Android的密钥分存方案;刘培鹤等;《计算机应用与软件》;20180215(第02期);全文 *

Also Published As

Publication number Publication date
CN110535642A (en) 2019-12-03

Similar Documents

Publication Publication Date Title
US10853270B2 (en) Cryptographic pointer address encoding
CN108900464B (en) Electronic device, block chain-based data processing method, and computer storage medium
US10089493B2 (en) Decentralized token table generation
KR101504857B1 (en) System and method for supporting jit in a secure system with randomly allocated memory ranges
US20160364707A1 (en) Potentate: A Cryptography-Obfuscating, Self-Policing, Pervasive Distribution System For Digital Content
US20160203087A1 (en) Method for providing security for common intermediate language-based program
EP3127034A1 (en) Software protection
CN113010856A (en) Dynamic asymmetric encryption and decryption JavaScript code obfuscation method and system
US11409653B2 (en) Method for AI model transferring with address randomization
WO2019062015A1 (en) Source code protection method, application server, and computer-readable storage medium
CN112115429A (en) Java class encryption and decryption method and computer readable storage medium
CN112052433A (en) Virtual protection method, terminal and storage medium for Jar file
CN110535642B (en) Method for distributing storage keys, intelligent terminal and storage medium
CN113221154A (en) Service password obtaining method and device, electronic equipment and storage medium
CN112052461A (en) Code processing method based on instruction injection, terminal and storage medium
EP3876119A1 (en) Method for protecting a data in a software application
CN116235174A (en) Apparatus and method for performing encryption algorithm
CN108427559B (en) Script file generation and calling method and device
CN110032832B (en) Web application processing method and device
CN111291333A (en) Java application program encryption method and device
US9021271B1 (en) Injecting code decrypted by a hardware decryption module into Java applications
CN111597576B (en) Android compilation-based assets file encryption method and related equipment thereof
CN113642020B (en) Dynamic encryption method and device for configuration file, electronic equipment and storage medium
US11556859B2 (en) Method for al model transferring with layer and memory randomization
CN114329357A (en) Method and device for protecting code security

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