Just a note: I'm slightly inebriated so...yeah.
I'm a big fan of open source software. I'm also a huge fan of the Hacker ideal of sharing information freely. However, I certainly understand your dilemma from an ethical standpoint. I think, in this case, you should consider a few pages from the Professional Hacker's Handbook(which may or may not be an actual book title).
Now, I dislike most business practices but there are some things that just make sense. Most of these things that 'make sense' are there for legal purposes, to protect a business. However, they also tend to serve well for moral/ethical purposes. As such, you might want to consider what makes sense from an Intellectual Property Protection point of view.
You have a piece of code that, in theory, is potentially incredibly useful. You can see the benefits to users for legitimate purposes but you can also identify certain areas or features in which it could be abused for illegitimate, and for potentially dangerous, purposes. As a business, releasing a product without some sort of legal protection would leave open an avenue that could bring much trouble. Now, I'm not a very business-minded person, but it seems to me that there are specific actions taken to help provide protection in a legal context. I think these could serve your purposes as well.
Traditionally, a business would copyright a write-up of related intellectual property. This helps to provide legal documentation of an 'original' concept. This also permits internal development whilst releasing information publicly on the software in development. It is this act that would likely help you cover both sides. Public information release whilst keeping actively developed code private.
Okay, so that was a bunch of information that may have been difficult to decipher; let me attempt to clarify.
Keep the actual code to yourself. You can, of course, give a copy to certain trusted individuals but keep in mind that doing so risks potential public exposure. If you are still wanting to share it with the community, then share the concept. Write up an overview and explain, in general terms, a potential method for creating a 'solution'. Script-kiddies without the ability to code will not be able to make it happen without paying someone else to produce the solution. Noobs with only minor coding skills would stumble and likely not be able to produce a valid solution without additional learning(you may consider it quite fortunate that it would encourage people to learn more). More advanced coders may have an easier time implementing a solution but then they have their own decision to make regarding release. You are thereby absolved of responsibility and still may retain credit as the originator of the solution. Furthermore, it may be quite beneficial professionally to have a publicized 'whitepaper'(since that's essentially what it would be) as well as your own private solution.
Anywho...good luck & stuff.