The present application relates to the technical field of data processing, and provided are methods and apparatuses for encrypting and decrypting data, a storage medium, and an encrypted file. The method for encrypting data comprises: acquiring a first key, and performing an obfuscation operation on the first key and data to be encrypted to obtain obfuscation operation result data; acquiring a second key, and obtaining a first signature of the obfuscation operation result data according to the second key; acquiring a third key, and using the third key to encrypt the first key, the data, and the first signature to obtain target ciphertext; acquiring a fourth key, and obtaining a second signature of the target ciphertext according to the fourth key; and generating an encrypted file comprising the target ciphertext and the second signature. The security of data protection may be improved by using the technical solution of the present application.