The Key module provides the ability to safely store API and encryption keys outside of the database via a variety of "key provider" plugins. Drupal 8 has a key provider plugin for using environment variables to store key values. This module adds the functionality to Drupal 7 as well. The Key module uses ctools plugin functionality to allow you to add additional key providers for handling your keys.