CN113111323A - FT2232H program programming equipment and method based on SHA-1 identity authentication - Google Patents
FT2232H program programming equipment and method based on SHA-1 identity authentication Download PDFInfo
- Publication number
- CN113111323A CN113111323A CN202110400688.2A CN202110400688A CN113111323A CN 113111323 A CN113111323 A CN 113111323A CN 202110400688 A CN202110400688 A CN 202110400688A CN 113111323 A CN113111323 A CN 113111323A
- Authority
- CN
- China
- Prior art keywords
- sha
- upper computer
- ft2232h
- computer
- programming
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/30—Authentication, i.e. establishing the identity or authorisation of security principals
- G06F21/31—User authentication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
- G06F8/63—Image based installation; Cloning; Build to order
Abstract
The invention discloses FT2232H program programming equipment and a method based on SHA-1 identity authentication, which belong to the field of embedded application, carry out system identity authentication based on SHA-1 encryption algorithm, and adopt a USB2.0 communication chip FT2232H of FTDI and SOC to design an efficient and safe memory programming system. The memory programming system is divided into an upper computer and a lower computer, the upper computer is connected with a TAP interface of the SOC by utilizing an FT2232H asynchronous FIFO interface, and the TAP interface is connected with an OCD module of the lower computer SOC to finish the mutual transmission of data. The upper computer generates an MAC value by using an SHA-1 encryption algorithm and completes identity confirmation with the lower computer, and the quick programming of various memories can be realized by calling a dynamic link library DLL provided by the upper computer.
Description
Technical Field
The invention relates to the technical field of embedded application, in particular to FT2232H program programming equipment and a method based on SHA-1 identity authentication.
Background
With the rapid development of technologies such as the internet, the internet of things and the like, embedded applications are increasingly popularized, and the use of a Flash memory cannot be separated from high-definition televisions, robots and automobiles and airplanes. FLASH has been widely used in embedded systems due to its characteristics of large storage capacity, high density, etc.
Because the Flash chips produced on the production line have no application program, each Flash chip can be used after the program is burnt. At present, the FLASH memory is mainly used for storing application programs developed by users. However, due to the breakthrough of packaging technology in recent years, it is very inconvenient for users to write Flash memories, especially when Flash chips are already soldered on the circuit.
Disclosure of Invention
The invention aims to provide FT2232H program programming equipment and a method based on SHA-1 identity authentication to solve the problems in the background art.
In order to solve the technical problem, the invention provides an FT2232H program programming device based on SHA-1 identity authentication, which comprises:
the upper computer is compiled based on C #, and comprises a dynamic link library FTCJTAG.dll and a driver ftd2xx.dll which are provided by an application layer APP and FT 2232;
the JTAG emulator comprises a JTAG Port physical interface;
the lower computer comprises a test port controller TAP, an on-chip debugger OCD and an SOC core;
the upper computer sends an instruction to the test port controller TAP by controlling the JTAG simulator, the test port controller TAP continues sending an instruction to the on-chip debugger OCD after receiving the instruction, and the upper computer and the lower computer realize data interaction through the layer of the on-chip debugger OCD.
Optionally, a FT2232H chip is integrated in the physical interface of the JTAG port, and a signal is communicated with the test port controller TAP after passing through the level shift chip.
Optionally, the generating, by the upper computer, a MAC value by using an SHA-1 encryption algorithm and the completing, by the lower computer, identity verification includes: the upper computer has the functions of SHA-1 encryption algorithm calculation, ROMID storage and random number generation;
the upper computer uses 64-bit ROMID and 448-bit random numbers to carry out SHA-1 encryption to generate a 160-bit MAC value 1;
the upper computer sends 448bit random numbers to the lower computer;
the lower computer encrypts SHA-1 according to the 64-bit ROMID and 448-bit random numbers to generate a 160-bit MAC value 2 and sends the MAC value 2 to the upper computer;
and the upper computer compares the MAC value 2 sent by the lower computer with the MAC value 1 generated by the upper computer, if the MAC values are equal, the identity verification is passed, and if the MAC values are unsuccessful, the identity authentication is failed.
The invention also provides an FT2232H program programming method based on SHA-1 identity authentication, which comprises the following steps:
the upper computer is written by C #, initializes FT2232H, TAP and OCD based on FTCJTAG.dll function interface, and controls the on-chip debugger OCD to operate SOC core to perform identity verification and programming;
the lower computer comprises normal initialization of the lower computer and programming drive of various memories.
Optionally, the programming driver is customized according to a driver code generated by the SOC core, and is used for processing initialization, identity authenticity identification and package command judgment of the SOC core; the subprogram adds ID reading, whole erasing, sector erasing, null detecting, reading or programming commands according to the requirement of the upper computer.
In the FT2232H program programming device and method based on SHA-1 identity authentication provided by the invention, system identity authentication is carried out based on an SHA-1 encryption algorithm, and an efficient and safe memory programming system is designed by adopting an FTDI (flash translation and integration) USB2.0 communication chip FT2232H and an SOC (system on chip). The memory programming system is divided into an upper computer and a lower computer, the upper computer is connected with a TAP interface of the SOC by utilizing an FT2232H asynchronous FIFO interface, and the TAP interface is connected with an OCD module of the lower computer SOC to finish the mutual transmission of data. The upper computer generates an MAC value by using an SHA-1 encryption algorithm and completes identity confirmation with the lower computer, and the quick programming of various memories can be realized by calling a dynamic link library DLL provided by the upper computer.
Drawings
FIG. 1 is a block diagram of a FT2232H programming device based on SHA-1 authentication provided by the present invention;
FIG. 2 is a diagram of an identity authentication architecture of the present invention;
FIG. 3 is a schematic diagram of the upper computer working process according to the present invention;
fig. 4 is a schematic diagram of the working process of the lower computer of the present invention.
Detailed Description
The following describes in detail a FT2232H programming device and method based on SHA-1 identity authentication according to the present invention with reference to the accompanying drawings and specific embodiments. Advantages and features of the present invention will become apparent from the following description and from the claims. It is to be noted that the drawings are in a very simplified form and are not to precise scale, which is merely for the purpose of facilitating and distinctly claiming the embodiments of the present invention.
Example one
The embodiment of the invention discloses FT2232H program programming equipment and a method based on SHA-1 identity authentication, and the main idea is to perform the programming function more efficiently and safely.
The programming device structure is shown in fig. 1 and comprises an upper computer, a JTAG emulator and a lower computer. The upper computer part comprises an application layer APP, a dynamic link library FTCJTAG.dll and a driver ftd2xx.dll which are provided by FT 2232; the JTAG simulator comprises a physical interface of JTAG Port, mainly integrates an FT2232H chip inside, signals communicate with a lower computer TAP after passing through a level conversion chip, wherein the level conversion chip is an SN74LVC2T45 chip, and converts a 3.3V level into a level required by FLASH between 1.8V and 5V according to a reference level of external FLASH; the lower computer part comprises a test port controller TAP, an on-chip debugger OCD and an SOC core. The upper computer sends an instruction to the test port controller TAP by controlling the JTAG simulator, the test port controller TAP continues to send an instruction to the on-chip debugger OCD after receiving the instruction, and the upper computer and the lower computer realize data interaction through the layer of the on-chip debugger OCD.
As shown in fig. 2, the upper computer and the lower computer have the same ID number and size of 64 bits, and the upper computer randomly generates a random value of 448 bits and sends the random value to the lower computer; the upper computer and the lower computer generate a 160-bit MAC value 1 and a MAC value 2 by using an SHA-1 encryption algorithm, the lower computer sends the MAC value 2 to the upper computer, the upper computer compares whether the MAC value 1 and the MAC value 2 are equal, if so, a programming program is executed, and if not, an error is reported. And the lower computer sets overtime waiting time, if the upper computer sends out a programming program within the specified time, the lower computer executes programming, otherwise, the lower computer does not execute programming.
As shown in fig. 3, the upper computer mainly includes: according to the method, the FT2232H device is opened according to the number of the FT2232H devices and the ID number of the FT2232H devices, initialization of the FT2232H devices is completed, the type of a JTAG simulator is obtained, initialization of the JTAG simulator is started, the timeout duration of the JTAG simulator is set, the frequency of the JTAG simulator is set, the mode of the JTAG simulator is set to be changed, GPIO pins of the JTAG simulator are set, initialization of the JTAG simulator is completed, the on-chip debugger OCD completes initialization, and downloading of a lower computer driver is started to complete command execution.
For example, in the erasing process, the erased packet data needs to be set firstly, the packet is downloaded to a designated packet processing area of the lower computer, a response signal sent by the lower computer to the upper computer is cleared, then the lower computer program starts to run, after the lower computer reads the information of the packet, the lower computer operates an erasing command according to the instruction, after the erasing is finished, the upper computer sends the response signal to the upper computer, after receiving the response signal, the upper computer stops running of the lower computer, and then the erasing thread is finished.
As shown in fig. 4, the lower computer mainly completes the following actions, the SOC core initialization, the pin multiplexing function setting, and the like, wherein the initialization of the lower computer requires to start a faster CPU clock, so that the access speed of the JTAG emulator, the speed of programming the lower computer sub-program SPI, and the initialization of the EMIF function module can be improved, and the FLASH program download of the SPIFLASH, NORFRASH, and ONCHIPFLASH can be completed according to the connected FLASH type.
The lower computer subprogram can add commands such as ID reading, whole erasing, sector erasing, null detection, reading, programming and the like according to the requirements of the upper computer.
The above description is only for the purpose of describing the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention, and any variations and modifications made by those skilled in the art based on the above disclosure are within the scope of the appended claims.
Claims (5)
1. An FT2232H program programming device based on SHA-1 identity authentication, characterized by comprising:
the upper computer is compiled based on C #, and comprises a dynamic link library FTCJTAG.dll and a driver ftd2xx.dll which are provided by an application layer APP and FT 2232;
the JTAG emulator comprises a JTAG Port physical interface;
the lower computer comprises a test port controller TAP, an on-chip debugger OCD and an SOC core;
the upper computer sends an instruction to the test port controller TAP by controlling the JTAG simulator, the test port controller TAP continues sending an instruction to the on-chip debugger OCD after receiving the instruction, and the upper computer and the lower computer realize data interaction through the layer of the on-chip debugger OCD.
2. The SHA-1-authentication-based FT2232H programming device of claim 1, wherein the JTAG Port is integrated with FT2232H chip in the physical interface, and the signal is communicated with the test port controller TAP through level conversion chip.
3. The SHA-1 authentication-based FT2232H programming device according to claim 1, wherein the host computer generating the MAC value by using SHA-1 encryption algorithm and performing the identity verification with the lower computer includes:
the upper computer has the functions of SHA-1 encryption algorithm calculation, ROMID storage and random number generation;
the upper computer uses 64-bit ROMID and 448-bit random numbers to carry out SHA-1 encryption to generate a 160-bit MAC value 1;
the upper computer sends 448bit random numbers to the lower computer;
the lower computer encrypts SHA-1 according to the 64-bit ROMID and 448-bit random numbers to generate a 160-bit MAC value 2 and sends the MAC value 2 to the upper computer;
and the upper computer compares the MAC value 2 sent by the lower computer with the MAC value 1 generated by the upper computer, if the MAC values are equal, the identity verification is passed, and if the MAC values are unsuccessful, the identity authentication is failed.
4. An FT2232H program programming method based on SHA-1 identity authentication is characterized by comprising the following steps:
the upper computer is written by C #, initializes FT2232H, TAP and OCD based on FTCJTAG.dll function interface, and controls the on-chip debugger OCD to operate SOC core to perform identity verification and programming;
the lower computer comprises normal initialization of the lower computer and programming drive of various memories.
5. The SHA-1 authentication-based FT2232H program burning device according to claim 4, wherein the burning driver is customized according to the driver code generated by the SOC core, and is used for processing the initialization, the identity authenticity identification and the package command judgment of the SOC core; the subprogram adds ID reading, whole erasing, sector erasing, null detecting, reading or programming commands according to the requirement of the upper computer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110400688.2A CN113111323B (en) | 2021-04-14 | 2021-04-14 | FT2232H program programming equipment and method based on SHA-1 identity authentication |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110400688.2A CN113111323B (en) | 2021-04-14 | 2021-04-14 | FT2232H program programming equipment and method based on SHA-1 identity authentication |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113111323A true CN113111323A (en) | 2021-07-13 |
CN113111323B CN113111323B (en) | 2022-08-16 |
Family
ID=76717535
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110400688.2A Active CN113111323B (en) | 2021-04-14 | 2021-04-14 | FT2232H program programming equipment and method based on SHA-1 identity authentication |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113111323B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102819232A (en) * | 2012-07-12 | 2012-12-12 | 中国人民解放军空军第一航空学院 | Portable monitoring and debugging system of flight control computer |
CN103677897A (en) * | 2013-11-06 | 2014-03-26 | 天津瑞能电气有限公司 | System chip and programming method of system chip |
CN112100692A (en) * | 2020-09-18 | 2020-12-18 | 北京国科环宇科技股份有限公司 | Encryption method and encryption device for hardware module |
-
2021
- 2021-04-14 CN CN202110400688.2A patent/CN113111323B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102819232A (en) * | 2012-07-12 | 2012-12-12 | 中国人民解放军空军第一航空学院 | Portable monitoring and debugging system of flight control computer |
CN103677897A (en) * | 2013-11-06 | 2014-03-26 | 天津瑞能电气有限公司 | System chip and programming method of system chip |
CN112100692A (en) * | 2020-09-18 | 2020-12-18 | 北京国科环宇科技股份有限公司 | Encryption method and encryption device for hardware module |
Also Published As
Publication number | Publication date |
---|---|
CN113111323B (en) | 2022-08-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7397717B2 (en) | Serial peripheral interface memory device with an accelerated parallel mode | |
US7237145B2 (en) | Fault-tolerant architecture for in-circuit programming | |
US8176281B2 (en) | Controlling access to an embedded memory of a microcontroller | |
CN110781532B (en) | Card opening device and method for verifying and enabling data storage device by using card opening device | |
US20070234142A1 (en) | Memory system, memory system controller, and a data processing method in a host apparatus | |
KR101949987B1 (en) | Data storage device and operating method thereof | |
US8266713B2 (en) | Method, system and controller for transmitting and dispatching data stream | |
US7793004B2 (en) | Computer peripheral device implemented as optic storage device or/and removable disk by software emulation and implementing method thereof | |
JP4218522B2 (en) | Electronic device, information processing device, adapter device, and information exchange system | |
US8883521B2 (en) | Control method of multi-chip package memory device | |
CN113111323B (en) | FT2232H program programming equipment and method based on SHA-1 identity authentication | |
CN112799887A (en) | Chip FT test system and test method | |
US9218478B2 (en) | Microcomputer, middleware, and operating method for the same | |
CN115577396A (en) | Memory security detection method and system on chip | |
CN115509965A (en) | Memory controller and link identification method | |
CN110058973A (en) | The test macro of data memory device and the test method of data memory device | |
CN114141291A (en) | Memory, memory control method and system | |
JP2009110335A (en) | Semiconductor device and data processing system | |
CN113672260A (en) | CPU initialization method for processor | |
CN113297581A (en) | Electronic device and secure firmware updating method thereof | |
CN111627491A (en) | Flash memory testing module based on USB3.0 and testing method thereof | |
KR20170117776A (en) | Operating method of semiconductor memory device | |
CN111443994A (en) | Simulation smart card driving program, information interaction system and working method thereof | |
TWI690805B (en) | Card activation device and methods for authenticating and activating a data storage device by using a card activation device | |
EP1639378A1 (en) | Memory bus checking procedure |
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 |