The invention discloses an identity recognition method and system based on a national cryptographic algorithm, and the method comprises the steps: transmitting a program and storage data through a debugging interface, the storage data comprising a public key, a private key, a program, a signature, and the like, and the program comprising a main program; Public key Hash is encrypted through a national cryptographic algorithm and then stored in an OTP module, and a private key, a signature and the like are encrypted through the national cryptographic algorithm and then stored in an eFLASH moduletogether with a main program. Comparing a public key hash of the OTP module with a result obtained by performing hash operation on a public key in the eFLASH module to verify the public key, and considering that the public key is legal when the comparison result is consistent; When the public key is legal, the private key is compared with the signature according to the sequence obtained by executing the main program to verify the private key, and when the comparison result is consistent, it is considered that the private key is legal and passes through the signature. According to the scheme,the problems of low security level and the like in the prior art are solved, and the security level is improved through multi-level encryption.