If a offered you $100,000 to keep something a secret, and then you signed your name on the contract and took the money, there's nothing illegal about that. It's called a non-disclosure agreement, and it's legal.
Don't believe me? Probably not. Anyway.....
Non-disclosure Agreement (NDA)
Non-Disclosure Agreements (NDA), also known as Confidentiality Agreements, Proprietary Information Agreements, Secrecy Agreements, etc., are commonly requested when two or more parties wish to enter into initial discussions about specific processes, methods or technology for the purpose of determining the potential for a future relationship. An NDA is a legal agreement which defines information that the parties wish to protect from dissemination and outlines restrictions on use. NDAs are also valuable to protect the ability to patent an invention, something that can be compromised if a disclosure of the invention becomes public knowledge. If you are sharing new processes, unpublished data or other confidential information, you should protect your rights by having an NDA in place.
Non-Disclosure Agreements (NDA), also known as Confidentiality Agreements, Proprietary Information Agreements, Secrecy Agreements, etc., are commonly requested when two or more parties wish to enter into initial discussions about specific processes, methods or technology for the purpose of...
www.research.psu.edu