The second approach, if you have the necessary rights, is to create a virtual disk. Place the key on the virtual disk.
During startup, you mount the virtual disk, read the encryption key, then disconnect the virtual disk. In some projects, you can refuse operating system permissions that allow you to mount a virtual disk - then it would be impossible for an attacker to read the key through your webapp.
This comes from a much older strategy that reads sensitive information from a CD (or even from a floppy disk). The application will read the key, and then eject the media. It works, but requires manual intervention to reboot the media until the next restart. It also does not work in modern environments where there are no CDs on the servers, let alone floppy drives.
source share