The invention discloses a data flow
encryption authentication method and application based on SM3 and SM4. The core of the scheme comprises the following steps: introducing a salt value
algorithm when a secret key is generated, splicing a secret character string and a random salt value, then carrying out SHA-256 Hash operation, intercepting first 16 bytes as an SM4 secret key, and enhancing
dictionary attack resistance;
key exchange is realized based on an SM2 asymmetric
encryption algorithm, a sender transmits a public key to a
receiver, the
receiver encrypts an SM4 key and then returns the SM4 key, and
secure transmission of the key is ensured through decryption of a private key; during
data processing, fragmentation is carried out according to a preset size, multiple threads are adopted to carry out independent SM4
encryption on each fragment, and after combination, a
ciphertext abstract is generated through an SM3
algorithm to verify integrity. According to the scheme, through salt value enhancement, SM2 key protection, multi-thread optimization and SM3
authentication, the problems of
key management,
transmission security and large file
processing efficiency are solved, the method is suitable for scenes such as
cloud computing, financial transactions and
the Internet of Things, and
confidentiality, integrity and availability guarantee is provided for data circulation.