A method for secure file sharing based on a domestic cryptographic algorithm, the method being applied to a communication system comprising a file sharing user terminal A, a file receiving user terminal B, and a key management center, the method for file sharing comprising the following steps: S1: registering, by a user, at a file sharing user terminal A and a file receiving user terminal B to generate corresponding usernames a and b, and sending, by the file sharing user terminal A and the file receiving user terminal B, registration information of the user to the key management center, wherein 1024 public keys are preset in each of the file sharing user terminal A and the file receiving user terminal B and form a 32x32 public key matrix, 1024 private keys are preset in the key management center and form a 32x32 private key matrix, and the 1024 private keys in the key management center and the 1024 public keys in each of the file sharing user terminal A and the file receiving user terminal B are in one-to-one correspondence and form a total of 1024 public and private key pairs in an asymmetric cryptographic algorithm SM2; S2: calculating, by the key management center, digest values of the usernames a and b with a digest algorithm SM3, combining the digest values with the private key matrix, calculating private keys sa and sb of the user with a combination algorithm, and sending the private key sa and the private key sb of the user to the file sharing user terminal A and the file receiving user terminal B, respectively; S3: specifying, by the user, a file f to be shared at the file sharing user terminal A, encrypting the file f to generate an encrypted shared file F, and sharing the shared file F with the file receiving user terminal B; and S4: receiving, by the file receiving user terminal B, the shared file F and then decrypting the shared file to obtain the file f specified to be shared. S1: registering, by a user, at a file sharing user terminal A and a file receiving user terminal B to generate corresponding usernames a and b, and sending, by the file sharing user terminal A and the file receiving user terminal B, registration information of the user to the key management center, wherein 1024 public keys are preset in each of the file sharing user terminal A and the file receiving user terminal B and form a 32x32 public key matrix, 1024 private keys are preset in the key management center and form a 32x32 private key matrix, and the 1024 private keys in the key management center and the 1024 public keys in each of the file sharing user terminal A and the file receiving user terminal B are in one-to-one correspondence and form a total of 1024 public and private key pairs in an asymmetric cryptographic algorithm SM2; S2: calculating, by the key management center, digest values of the usernames a and b with a digest algorithm SM3, combining the digest values with the private key matrix, calculating private keys sa and sb of the user with a combination algorithm, and sending the private key sa and the private key sb of the user to the file sharing user terminal A and the file receiving user terminal B, respectively; S3: specifying, by the user, a file f to be shared at the file sharing user terminal A, encrypting the file f to generate an encrypted shared file F, and sharing the shared file F with the file receiving user terminal B; and S4: receiving, by the file receiving user terminal B, the shared file F and then decrypting the shared file to obtain the file f specified to be shared.