Controlled publication of an efficient factoring algorithm? Is there a procedure in place to cover the possibility that someone might find an efficient algorithm to factor large numbers and thereby break RSA encryption? This is just an instance of the more general problem where someone wants to publish a result that breaks an encryption standard. It seems like there are two main possibilities (I welcome the consideration of others):


Full publication, say, to a widely-read web site, newsgroup, etc. Likely outcome: chaos on a large scale as criminals break into the private spaces of innocent individuals.
Limited dissemination, perhaps to a few mathematicians or a government agency. Likely outcome: the government grabs control of the algorithm (and potentially its discoverer) and does the unpleasant things governments do with such things. 


Of course, possibility 2 could easily devolve into possibility 1 if the algorithm becomes public.

Is there a consensus in the academic world about what to do with this problem?
You can prove that you have the algorithm without publishing it by publishing the factorization of a large number of well known test cases. Then people have time to adapt to a possible threat. If you are afraid of the government or the mafia, there is a sufficient number of ways to publish the algorithm at a preset date in the future, from cron jobs to hidden messages to good old notaries.