It's not a decryption, actually (if it were, we wouldn't have anything to do with the specifics here
). It's just telling the file that it's a Kindle file and changing the extension to .azw -- well, that and adding the Kindle's PID to the file before it's downloaded.
I think igorsk had a black box app to handle it.