# HyperIO: A Hypervisor-Based Framework for Secure IO
## 6 Applications
### ClipCrypt--Secure IO in Graphical Applications
When the user presses the \"scroll lock\" key, ClipCrypt fetches the clipboard content's textual representation. Whereas the clipboard may contain multiple formats of the same  
Figure 4: Using ClipCrypt to encrypt the body of an email. The user presses the “scroll lock” key to switch to the secure mode. In the secure mode, the user can edit the text they wish to encrypt. Then, the user presses the ”scroll lock” key again. The encrypted message is stored in the Windows clipboard. By pressing the “CTRL + V” key combination, the user can paste the encrypted message into the body of the email. data simultaneously, e.g., formatted text, regular text, and image, HyperIO's output is limited to a plain textual representation. ClipCrypt translates the clipboard's textual representation from Base64 to binary and passes it as the first parameter to the HcDisplay hypercall. The second parameter is the certificate of HyperIO, which will instruct HyperIO to encrypt the user's input using its public key. If the clipboard is empty, ClipCrypt transmits to HyperIO an encrypted empty string. This behaviour allows the user to start writing an encrypted message from scratch. HyperIO switches back to the regular mode when the user presses the \"scroll lock\" key, which is replaced by \"1\". ClipCrypt responds to \"1\" by issuing the HcAcquire hypercall. Then, ClipCrypt translates the encrypted input to the Base64 format and copies it to the clipboard. Although our approach is sufficiently general to be applied in various circumstances, it suffers from two deficiencies. The first is a slight inconvenience. Consider, for example, a situation where the user wants to edit a text field containing sensitive information. Using ClipCrypt, the user must perform the following steps:  
1. select the current content by pressing \"CTRL + A\";
2. copy this content to the clipboard by pressing \"CTRL + C\";
3. press the \"scroll lock\" key to enter the secure mode;
4. perform the actual editing and presses the \"scroll lock\" key to return to the regular mode;
5. paste the content of the clipboard by pressing \"CTRL + V\". Step 4, in which the user performs the editing, cannot be discarded. Other steps, however, can be automated by ClipCrypt, as explained below. The idea is to emulate key presses using the keybd_event function of the Win32 API to perform selection, copying and pasting in the focused component. ClipCrypt performs the emulation when the user clicks an editable component. Due to the great variety of editable components, ClipCrypt allows the user to configure the set of components that are considered editable. We have successfully implemented this approach in programs distributed by Microsoft: Word, Outlook, and Notepad, and some non-Microsoft programs, such as the mIRC chat program and Notepad++. Unfortunately, some applications, including LibreOffice Writer and Mozilla ThunderBird, do not use Windows API for rendering their components. From ClipCrypt's point of view, these applications resemble a single component and cannot be supported. Upon clicking an editable component, ClipCrypt invokes the keybd_event function (multiple times) to select and copy the first nine characters that follow the input cursor to the clipboard. For example, if the copied string is the magic \"CLIPCRYPT,\" ClipCrypt will request HyperIO to switch to the secure mode. ClipCrypt copies the following eight characters, representing the encrypted data's length in a hexadecimal format. Then, ClipCrypt copies the encrypted data and issues the HcDisplay hypercall. Finally, ClipCrypt prepends the encrypted data returned by the HcAcquire hypercall with its length and a magic string to support this additional functionality. The second drawback is making the user responsible for classifying specific inputs as sensitive. The end-user may need to be qualified to decide whether particular information is sensitive and should be encrypted. Moving this responsibility from the end user to a security specialist may be beneficial.