1. A computer program product to allocate blocks of memory in a memory device having a plurality of blocks, the computer program product comprising a computer readable storage device having computer readable program code including an application and an operating system embodied therein that executes to communicate with processor registers and a memory device and perform operations, the operations comprising: executing at least one unencrypted memory allocation function coded in the application to request allocation of unencrypted blocks in the memory device; executing an encrypted memory allocation function coded in the application to request allocation of encrypted blocks in the memory device; executing at least one unencrypted Input/Output (I/O) request function coded in the application indicating an I/O operation to perform against the unencrypted blocks in the memory device; executing at least one encrypted I/O request function coded in the application indicating an I/O operation to perform against the encrypted blocks in the memory device; storing an encryption key in the processor registers; caching the encryption key from the processor registers in the memory device to use to encrypt and decrypt data in the encrypted blocks; executing the operating system to use the encryption key associated with the encrypted blocks to encrypt or decrypt data in the encrypted blocks to perform the encrypted I/O operation in response to processing the encrypted I/O request function, wherein the unencrypted and encrypted memory allocation functions and unencrypted and encrypted I/O request functions comprise different functions in a library of functions available to the application; periodically erasing the encryption key cached in the memory device; and accessing the encryption key from the processor registers to cache in the memory device after erasing the encryption key and in response to a subsequent encrypted I/O request function to use for further encrypted I/O request functions.