The reasons those secret keys were so easily discovered is because they were hidden in software.
Avoid hiding secrets in software at all cost – obfuscation will only get you so far. Ask yourself this: How well can I hide a key in software from someone with full access to the disassembly, user mode and kernel mode debuggers, and no day job? It’s only a matter of time before it gets cracked.