Skip to main content

Posts

Showing posts from September, 2018

PHP, GnuPG, and gpg-agnet when decryption

I am now trying to write a small web application in PHP for my personal use. It reads a file encrypted with my GnuPG public key, decrypts it, and shows the content in pretty HTML format. Because PHP natively supports many GnuPG wrapper functions, I only wrote codes to call those wrapper functions. By the GnuPG's nature, you have to provide the pass phrase before decrypting the file to retrieve the secret key . I configured up my application running with my user ID under user-dir directory, i.e. ~/public_html, within apache 2.4 prefork process. This setting requires Apache 2 PHP module as well as mod_ruid2, which enables apache handlers to run under the user-dir. When I ran my PHP application  supplying my key ID and its pass phrase as the form input elements on my desktop browser, an unusual pop-up window came up. It is not the browser's one, but the keyring manager's window on my desktop environment.  It surprised me because normal web applications don't do such