As the title says how to encrypt your configuration file, so that IF someone get into your box, he cannot read your configuration file because it is encrypted, but the eggdrop have to read it, otherwise he cannot load the settings
Right, I have a little more time on my hands now, so lets go a little more indepth as to why encryption of this kind is silly and impossible.
OK, I conceed there are a few ways to prevent people from getting the password.
One method is to code the bot such that it reacts to being traced. There are two cources of action here.
1: Destroy the de/encryption password key
2: Kill the bot, so there is no longer a process to trace
There is one large flaw here. An attacker only needs to attempt a trace, and they bring your channel to a standstill with regards to protection.
With method 1, it can no longer tell who a bot owner is from an attacker. The user list is usless. With method two, the bot isn't there to do the protection.
Also with method one, you could potentialy put the channel into a deep security mode. Where the bot will not let anybody change a mode, and deop people. The only issue with this, if two bots are attacked, they would not know each other is safe, thus you end up with a shortlived war, then when bots are restarted, a channel without ops.
That covers protections methods. Lets talk about what they are designed to protect the bot from.
Common tools used to trace program execution, are usualy intended for programers to know what data is where and when.
All well and good, but it also allows attackers to know what passwords are where and when.
There are three locations you could specify the password de/encryption key.
1: Within the source code
2: Specified on the command line at startup
3: When you start the bot, you are asked for it before the program continues.
All three will occupy memory once the bot is loaded. You can't just destroy it once the bot has started, otherwise, what password is used to re-encrypt the userfile and such.
The said debug tools noted above will do the following.
1: Trace the code path and store it
2: The attacker then reads back this information.
3: They locate a line relating to decryptiing the data or resaving
4: Bingo, they should have the information needed to further the quest.
However, with method 2, you must assume there are more than one bot (across multiple machines) guarding the channel.. In which case, a single bot not being there for protection isn't going to hurt any... Assuming of course, only the one machine is comprimised.
a simple solution (unless your useing a windrop....)
chmod
unless root is trying to access your files, dont worry. you haveto tick someone off alot if they hack a machine, make themselves root, and all they do is look for your bot passwords and settings. Its safe just to restrict access to the file to you.
Public encryption will only keep your files secure from "good guys".
Your brother decides to log into your shell and play with the files, but because he is an idiot he won`t know know how to decrypt.
This is the same concept of those 3rd party firewall software, it only blocks out people with no knowledge.
If someone really wanted to, they could decrypt your files regardless.