This is probably what most of us would refer to as an "X files" like reponse ;-)
Just for the record, I also think that -at least under the outlined circumstances- this would boil down to being "intellectual theft", so it really comes down to the specifics in your contract.
Also, personally I would ask myself a couple of questions, like:
- why do I really want to release this source code to the public?
- what is so revolutionary about it?
- is it worth the possible hassle (i.e. being unemployed/getting sued)?
So, I cannot only relate to your situation, but also to your employer's situation-and I would in fact be very fed up with an employee who simply releases my IP into the open/public domain (or as open source), certainly if that means that I may sacrifice a competitive advantage. Have you signed any NDAs?
Thus, it's indeed an ethical dilemma.
On the other hand, I can also understand the sentiment that something really needs to be made known to mankind (if that's really the case), so if your code were to solve major worldwide issues like "world hunger", "world poverty", "cancer", "AIDS", or the "energy crisis" by coming up with clean nuclear power, then for god's sake: what the heck ;-)
No, honestly: if I were in a similar situation, where I would be convinced that releasing info into the open -that I developed under contract- in order to possibly help mankind in some major way, I would consider distilling it down into very abstract, algorithmic basics that could be easily and anonymously posted to websites like wikileaks.org.
In fact, just re-implementing the algorithms in a niché language (think brainfuck ;-)) could also help obfuscate the origins, there are so many niché languages that are not mainstream, and which are not necessarily understood by many developers.
In fact, you could even encrypt or password-protect your info, so that it will need to be unlocked by whatever 3rd party is interested in it, so that you didn't really provide anything directly. Using encryption schemes that can be cracked in a foreseeable time frame by the corresponding computing power, would give you the guarantee that your code will eventually be unlocked by someone.
However, in any way I would most certainly refrain from releasing anything that's associated with my name or any other personal information that could be used against me in a worst case scenario. In fact, I wouldn't even engage in any activities related with such an effort from my work place, home or any place that could be directly linked back to me.