Drupal 6 Module Storing configuration setting in file I have built a module that uses encryption and I need to store the encryption key somewhere so that it is configurable.

I would like to put it in a file (the equivalent of web.config of .NET website) so that it can be altered but is safe.

Assuming the web server will take care of restricting access to the file, where should I put this file? Is there an existing file for adding configurable settings to per module or even per website (and how can I read these)? Do I have to do something on module install, or in the module info file?

Any help would be appreciated.
The Question was not so clear to me but I can suggest you 2 things.


You can use variable_set('salt', 'unique_hash'); in the .install file in hook_install(). Then this variable will be stored in the variables table. In hook_uninstall() you add variable_del('salt'); So this will remove the variable from the table if the module is uninstalled. You can access it via variable_get('salt', 'default_value'); Also if you want to change it then make a form text field and in the hook_submit for that form make a variable_set('salt', 'edited_value') call. This will update the variable in the variables table. Use user_access() to restrict all users to access it. 
The second is, to make a text file in the server file system and make it's permission as 644. Then read the file by php's fread() function and access the file value.