The invention relates to the technical field of
database security, in particular to an SQLite
database transparent
encryption method,
system and device based on a national cryptographic
algorithm and a storage medium, and the method comprises the following steps: S1, when an SQLite
database is opened, loading and connecting a hardware cryptographic device to obtain an
encryption master key and a corresponding key
handle; s2, in response to the write-in operation, calling a national secret symmetric
encryption algorithm through a key
handle, encrypting a
plaintext of a database page to generate a page, and writing the page into a
database file; s3, reading the
ciphertext page in response to the reading operation, decrypting the
ciphertext page through a cryptographic symmetric decryption
algorithm adjusted by a key
handle after analysis, recovering a
plaintext page and returning the
plaintext page to the application; and S4, circularly executing encryption writing and decryption reading to process the continuous request, and releasing the key handle and disconnecting the hardware connection until the
database connection is closed. According to the method, transparent full
disk encryption, meeting the national secret standard, of the SQLite database is achieved, the secret key safety and the operation performance are guaranteed through hardware cryptographic equipment, and good application compatibility is kept.