I very strongly disagree. Crypto patents are actively poisonous for engineering, for research and development, and you should feel bad for cheerleading them.
The RSA patent pretty much delayed the adoption of public-key cryptography by circa 20 years; ECC patents, even though many are now expiring, some are still delaying it, and patents were the main reason for the SECP/NIST curve derivation being so very opaque. Patents on some ideal lattice schemes will likely delay their adoption, too.
That's a counterfactual; we don't know what would have happened if patenting RSA wasn't possible in at least one country (it wasn't patented in most of the world). Would its discoverers have published it anyway? Would their publication be known to the creators of the SSL protocol? Would the SSL creators have used a different system if they didn't know of RSA?
The John Nash example tells us nothing, since it was from 30 years earlier (missing the demand from the Web), and he did have the option (which it seems he didn't use) to publish his discovery for the wider public.
And there's independent discovery. RSA had already been independently discovered at least once; we don't know how long it would take until it was independently discovered again, if it hadn't been published that time.
I do remember that the RSA patents were one factor which held back wider adoption of public key encryption; people were anxiously waiting for it to be freed, to the point of scheduling parties for the day the patents expired (only for it to be messed up by the patents being freed a few days earlier).
So using RSA to argue for or against software patents is not a simple matter. But my point was not to argue for or against software patents; what I wanted to know how is how come I always hear that math is not patentable in the USA, yet clearly mathematical algorithms are patented there all the time.
I'm not sure I understand what exactly your arguments for the usability of patents is. I understand you argue RSA was a boon for e-commerce because encryption was a boon for e-commerce. This is true, encryption enabled e-commerce. However, I do not see how patents helped and it looks to me like you made no argument to support that point. Your argument seems to be "RSA built crypto, crypto is useful, RSA had patents, ergo - patents are useful". Such argument is a non-sequitur. And nowhere you proved that "it happened via patents", meaning that patents were necessary for the creation of e-commerce, not just a means for some people to extract some rent from something that would have happened anyway.
John Nash's example is not exactly relevant as in 1955 there was not much to do with encryption - modern e-commerce could not exist back then because there was no supporting technology (like personal computing, widely deployed broadband networks, etc.) to enable it. There are many examples of things invented before it was their time and forgotten, only to be re-discovered later with much success. Specifically, the history of cryptography is ripe with examples of cyphers invented, forgotten, reinvented and re-forgotten, and being misunderstood and mis-applied by powers using it.
You proceed to argue that patents are short. This argument seems to me deficient in two ways. First, if patents are so beneficial, why it is good that they are short? Why not have more of a good thing? Second, the example of copyright and the Mickey Mouse protection laws stretching copyright durations well beyond the original lengths show us that it is much easier to extend the length of the rent-extraction period than keep it short. The only reason why it has not happened yet is that the interested parties do not have enough political clout, and the speed of innovation has been enough that even the relatively short times we have now are enough to extract sufficient rent (with pharma, movement to extension is already happening). However, if the innovation slows down and the clout raises, we will have the same term extensions we have now with copyrights.