title: Best practices for using pgcrypto PGP encryption with Heroku and Rails
body: <p>Are there any security best practices for using Rails and Heroku Postgres with pgcrypto's public key PGP.</p>
  
  <p>The naive and direct way seems to be to store the private key and password using Heroku's ENV variables. However this seems like it doesn't add much security since both values are now easily accessed by anyone with access to the environment.</p>
  
  <p>The goal of this would be to encrypt any privacy concerned information such as SIN numbers appropriately.</p>
  
  <p>Scenario:</p>
  
  <p>Let's presume you have some fields that, for some generic regulatory privacy requirement, are required or recommended to be stored encrypted, such as government IDs (SIN numbers for example). What is an appropriate or even common process for encrypting this information using pgcrypto.</p>
  
  <p>If someone has an alternative suggestion for a scenario I'd be glad to include that as well.</p>