Ah, forgive me if I'm missing something important, but unencrypted mobi files convert fine using Calibre. I've done a fair number of these with no problems and no formatting issues. Or was the question more about coding or having a standalone program to do this?