The invention belongs to the technical field of
information security, and discloses a virtual
disk encryption method and device based on a Ukey. The method comprises the following steps: after Ukey access is detected, creating a virtual disk partition, generating a blank
mirror image file according to input file information, writing a preset file content structure and encrypted information obtained by encrypting a symmetric
encryption key generated by a secure random
number generator by using an
encryption certificate exported by the Ukey into the blank
mirror image file, and storing the blank
mirror image file in the virtual disk partition; and finally, encrypting formatted file data in a
file system by using a symmetric
encryption key to obtain
ciphertext data, generating an encrypted disk mirror image file by combining the
ciphertext data with the written preset file content structure, realizing separation management of the key and the data by using UKey equipment, and storing the key in the UKey. A physical
chip is used for protecting the secret key, the risk of secret
key leakage is greatly reduced, the data safety is improved, meanwhile, encrypted mirror image file data in a unified format can be seamlessly used between different platforms, and higher flexibility and convenience are achieved.