CN107769919B - Key writing method - Google Patents
Key writing method Download PDFInfo
- Publication number
- CN107769919B CN107769919B CN201710842059.9A CN201710842059A CN107769919B CN 107769919 B CN107769919 B CN 107769919B CN 201710842059 A CN201710842059 A CN 201710842059A CN 107769919 B CN107769919 B CN 107769919B
- Authority
- CN
- China
- Prior art keywords
- key
- information
- turning
- authority
- writing
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 31
- 208000011580 syndromic disease Diseases 0.000 claims description 6
- 238000005516 engineering process Methods 0.000 abstract description 2
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000004075 alteration Effects 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0894—Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Storage Device Security (AREA)
Abstract
The invention relates to an information security technology, in particular to a writing method of a secret key, which is applied to matching virtual interfaces of various storage media; step S1, obtaining key name information of a preset key, and judging whether the key name information is correct; step S2, obtaining the key type information of the key, and judging whether the key type information is correct; step S3, obtaining the key authority information of the key, and judging whether the key authority information has the authority of the write-in operation; step S4, acquiring the media type information and drive information of the storage medium to determine whether the storage medium supports the key write operation and whether the storage medium is mounted with a drive; step S5, writing the key to the storage medium through the virtual interface; step S6, end; the same key can be conveniently matched with different storage media, and the method is high in efficiency and high in speed.
Description
Technical Field
The present invention relates to an information security technology, and in particular, to a method for writing a secret key.
Background
The key code generally refers to important data that is small in data volume and is programmed only in a factory, and is mainly used for uniquely identifying and authorizing a product. Since its presence is very important, it is usually stored on a small capacity secure medium.
At present, different burning methods or burners are usually required for burning key codes of different storage devices in the industry, for example, when the storage media are different from the same ethernet physical address, the writing of the storage media is different.
In an embedded electronic device software system, a key code is widely available, and many security programs use the key code. A typical class of applications: when the user pays different fees, we can make the same hardware device obtain different authorization by storing different key codes. Since the usage scenarios of the key codes are not few, different storage devices are commonly used in the product to store the key codes for different purposes, and it is cumbersome to match the same key code with different storage media.
Disclosure of Invention
Aiming at the problems, the invention provides a key writing method, which is applied to matching virtual interfaces of various storage media; the method comprises the following steps:
step S1, obtaining key name information of a preset key, and judging whether the key name information is correct, if yes, turning to step S2, otherwise, turning to step S6;
step S2, obtaining the key type information of the key, and judging whether the key type information is correct, if yes, turning to step S3, otherwise, turning to step S6;
step S3, obtaining the key authority information of the key, and judging whether the key authority information has the authority of writing operation, if yes, turning to step S4, otherwise, turning to step S6;
step S4, obtaining the medium type information and drive information of the storage medium to judge whether the storage medium supports the key writing operation and whether the storage medium is installed with a drive, if yes, turning to step S5, if at least one is not, turning to step S6;
step S5, writing the key to the storage medium through the virtual interface;
step S6 ends.
In the above writing method, the key name information, the key type information, and the key authority information of the key are stored in a configuration script.
In the above writing method, the key is further configured with key quantity information, and the key quantity information is used to configure the number of the supported keys.
In the above writing method, a standard key name list is preset;
in step S1, the specific method for determining whether the key name information is correct is: and searching whether the key name exists in the standard key name list, if so, judging the key name to be correct, and if not, judging the key name to be wrong.
In the above writing method, the key type information includes syndrome information, and the syndrome information is used to record whether the key is modified.
In the above writing method, in step S3, it is determined whether the key authority information has the authority for writing operation, and it is also determined whether the key authority information has the authority for reading and/or erasing operation.
Has the advantages that: the key writing method provided by the invention can conveniently match the same key with different storage media, and has high efficiency and high speed.
Drawings
Fig. 1 is a flowchart illustrating steps of a method for writing a key according to an embodiment of the present invention.
Detailed Description
The invention is further illustrated with reference to the following figures and examples.
As shown in fig. 1, in a preferred embodiment, a method for writing a key is proposed, wherein the method is applied to match virtual interfaces of a plurality of storage media; the method can comprise the following steps:
step S1, obtaining key name information of a preset key, and judging whether the key name information is correct, if yes, turning to step S2, otherwise, turning to step S6;
step S2, obtaining the key type information of the key, and judging whether the key type information is correct, if yes, turning to step S3, otherwise, turning to step S6;
step S3, obtaining the key authority information of the key, and judging whether the key authority information has the authority of the write-in operation, if yes, turning to step S4, otherwise, turning to step S6;
step S4, obtaining the medium type information and the drive information of the storage medium to judge whether the storage medium supports the key writing operation and whether the storage medium is installed with a drive, if yes, turning to step S5, if at least one is not, turning to step S6;
step S5, writing the key into the storage medium through the virtual interface;
step S6 ends.
In the above technical solution, the plurality of storage media may include an EEPROM (Electrically Erasable Programmable Read-Only Memory, abbreviated as EEPROM), an SPI flash (serial interface flash Memory), an OTP Memory (One Time Programmable Memory, abbreviated as OTP Memory), and the like; because the key is required to be subjected to complicated programming work when the storage medium is directly written, the process of writing the key into different storage media can be simplified after the virtual interface is adopted.
In a preferred embodiment, the key name information, the key type information and the key authority information of the key are all stored in a configuration script, and each key adopts the configuration script with the same mode, so that the configuration process can be greatly simplified.
In a preferred embodiment, the key is further configured with key quantity information, which is used to configure the number of keys supported.
In a preferred embodiment, a standard key name list is preset;
in step S1, the specific method for determining whether the key name information is correct is: and searching whether the key name exists in the standard key name list, if so, judging the key name to be correct, and if not, judging the key name to be wrong.
In a preferred embodiment, the key type information includes a syndrome information, and the syndrome information is used for recording whether the key is modified.
In a preferred embodiment, in step S3, it is determined whether the key right information has the right of writing operation, and it is also determined whether the key right information has the right of reading and/or erasing operation.
While the specification concludes with claims defining exemplary embodiments of particular structures for practicing the invention, it is believed that other modifications will be made in the spirit of the invention. While the above invention sets forth presently preferred embodiments, these are not intended as limitations.
Various alterations and modifications will no doubt become apparent to those skilled in the art after having read the above description. Therefore, the appended claims should be construed to cover all such variations and modifications as fall within the true spirit and scope of the invention. Any and all equivalent ranges and contents within the scope of the claims should be considered to be within the intent and scope of the present invention.
Claims (6)
1. A writing method of a key is characterized in that the method is applied to matching virtual interfaces of various storage media; the method comprises the following steps:
step S1, obtaining key name information of a preset key, and judging whether the key name information is correct, if yes, turning to step S2, otherwise, turning to step S6;
step S2, obtaining the key type information of the key, and judging whether the key type information is correct, if yes, turning to step S3, otherwise, turning to step S6;
step S3, obtaining the key authority information of the key, and judging whether the key authority information has the authority of writing operation, if yes, turning to step S4, otherwise, turning to step S6;
step S4, obtaining the medium type information and drive information of the storage medium to judge whether the storage medium supports the key writing operation and whether the storage medium is installed with a drive, if yes, turning to step S5, if at least one is not, turning to step S6;
step S5, writing the key to the storage medium through the virtual interface;
step S6 ends.
2. The writing method according to claim 1, wherein the key name information, the key type information, and the key authority information of the key are stored in a configuration script.
3. The writing method according to claim 1, wherein the key is further configured with key number information, and the key number information is used to configure the number of the keys supported.
4. The writing method according to claim 1, further comprising presetting a standard key name list;
in step S1, the specific method for determining whether the key name information is correct is: and searching whether the key name exists in the standard key name list, if so, judging the key name to be correct, and if not, judging the key name to be wrong.
5. The writing method according to claim 1, wherein the key type information includes syndrome information, and the syndrome information is used to record whether the key is modified.
6. The writing method according to claim 1, wherein in step S3, it is determined whether the key authority information has the authority for writing operation and at the same time, it is determined whether the key authority information has the authority for reading and/or erasing operation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710842059.9A CN107769919B (en) | 2017-09-18 | 2017-09-18 | Key writing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710842059.9A CN107769919B (en) | 2017-09-18 | 2017-09-18 | Key writing method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107769919A CN107769919A (en) | 2018-03-06 |
CN107769919B true CN107769919B (en) | 2021-04-27 |
Family
ID=61265131
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710842059.9A Active CN107769919B (en) | 2017-09-18 | 2017-09-18 | Key writing method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107769919B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104951706A (en) * | 2014-03-27 | 2015-09-30 | 意法半导体(R&D)有限公司 | Method and apparatus for storing content |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5022201B2 (en) * | 2007-12-10 | 2012-09-12 | 日立オムロンターミナルソリューションズ株式会社 | Authentication system |
US8953796B2 (en) * | 2011-06-29 | 2015-02-10 | International Business Machines Corporation | Techniques for accessing features of a hardware adapter |
CN104123124A (en) * | 2013-04-26 | 2014-10-29 | 鸿富锦精密工业(深圳)有限公司 | Burning control device and method |
US20140366155A1 (en) * | 2013-06-11 | 2014-12-11 | Cisco Technology, Inc. | Method and system of providing storage services in multiple public clouds |
-
2017
- 2017-09-18 CN CN201710842059.9A patent/CN107769919B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104951706A (en) * | 2014-03-27 | 2015-09-30 | 意法半导体(R&D)有限公司 | Method and apparatus for storing content |
Non-Patent Citations (1)
Title |
---|
虚拟化设备模型及其相关机制;石磊著;《Xen虚拟化技术》;华中科技大学出版社;20090531;第8.2节 * |
Also Published As
Publication number | Publication date |
---|---|
CN107769919A (en) | 2018-03-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7970983B2 (en) | Identity-based flash management | |
KR100337769B1 (en) | Memory system | |
US7903474B2 (en) | Redundant purge for flash storage device | |
TWI451248B (en) | Data protecting method, memory controller and memory storage apparatus | |
US9740561B2 (en) | One-time programmable memory device and method for verifying data for such memory device | |
US8429326B2 (en) | Method and system for NAND-flash identification without reading device ID table | |
JP6399523B2 (en) | Method and memory device for protecting the contents of a memory device | |
US9817605B2 (en) | Systems and methods of storing data associated with content of a data storage device | |
US9772937B2 (en) | Data processing method, memory controller and memory storage apparatus | |
CN103377140A (en) | Storage controlling apparatus, storage apparatus, information processing system and processing method | |
CN100550206C (en) | A kind of method and device of surveying physical parameters of flash memory | |
CN107609427A (en) | EEPROM data storage method and system | |
CN107769919B (en) | Key writing method | |
TWI396090B (en) | Flash memory apparatus, data storage system, and method for sending special instructions to a flash memory apparatus | |
US20070022222A1 (en) | Memory device and associated method | |
WO2016066099A1 (en) | Anti-counterfeiting of component | |
CN115525933B (en) | Data tamper-proof method, device, electronic equipment and storage medium | |
JP6308074B2 (en) | Microcomputer | |
CN102591738B (en) | Data management method, memory controller and embedded memory storage device | |
CN101814009B (en) | Flash device, data storage system and method for transmitting special command to flash device | |
JP6314859B2 (en) | Electronic control device and software rewriting system | |
US20070088905A1 (en) | System and method for purging a flash storage device | |
JP5786702B2 (en) | Security token, instruction execution method in security token, and computer program | |
CN111949198A (en) | Bad block management method and device and storage equipment | |
CN111433765A (en) | Log storage method, log reading method, intelligent battery and unmanned aerial vehicle |
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 |