And if we could, would we tell anybody? Or would we let this "undetectable" technology be sold around the world instead?
‘Undetectable’ AIP technology similar to that used on the Gotlands has been sold for more than a decade. Pakistan procured a French made system for its submarines while at least 4 countries have purchased German-built fuel cell powered subs. The Swedish Stirling closed cycle diesel technology used on the Gotland has also been purchased by Japan for its subs.
I think that it probably uses fuel cell technology to generate electricity. As for quiet, well that has a lot to do with the shape of the hull and propeller disturbing the water as little as possible. But military secrets are the hardest to keep and one weapon is soon outmoded with a countermeasure.
There’s no such thing as UNdetectable, be it stealth aircraft or quiet submarines.
They’re just really, really, really hard to detect, and in the case of modern diesel subs with AIP, you have to be amamzingly close to detect them.
As has been publicly stated by the USN, in regard to these subs, “passive is dead”; you have to be so close to even have a shot to pick them up passively you’re well inside their weapons envelope.
You have to be actively pinging away.