Provided is a method, system, and program for encrypting files in a computer
in communication with a volatile memory and non-volatile storage device. An encryption
code is generated to encrypt a file and a decryption code is generated to decrypt
one file encrypted with the encryption code. The decryption code is loaded into
the volatile memory, wherein the decryption code is erased from the volatile memory
when the computer reboots. Files written to the non-volatile storage device are
encrypted using the encryption code and the decryption code in the non-volatile
memory is used to decrypt files encrypted with the encryption code to transfer
from the non-volatile storage device to the volatile memory.