You’ve developed a great software product, and you’re looking to protect it.
There are a few ways to get legal protection. First and foremost, you can file for a copyright on the code. The Copyright office states:
Copyright protection extends to all the copyrightable expression embodied in the computer program. Copyright protection is not available for ideas, program logic, algorithms, systems, methods, concepts, or layouts.
This provides protection if someone copies your program without a license, or if they copy actual portions of the code itself.
Software patents are another common way to obtain some protection. Software patents are in a bit of a state of flux legally. They can be difficult to obtain and enforce. When properly prosecuted, a software patent can prevent someone from using your invention even if they came about it independently from you.