Are these badges you obtained legitimately through Badge Arcade? If I'm not mistaken, those are tied to your NNID, so it doesn't matter what is on your SD card as far as those are concerned. If they're badges you installed yourself using homebrew, can't you just install them again?
The encryption is mostly irrelevant as long as a System Format hasn't been done – creating a new Nintendo 3DS folder isn't going to affect that. It's just a matter of locating the save data in the apporpriate folders and copying it back again after re-installation. (Also Anti Savegame Restore might have to be accounted for in some situations.)
Then you might as well start over fresh with an empty SD card – either get a new one or use your current one (after backing up the contents one more time, formatting it, and testing it with h2testw while it is empty). People lose their SD cards one way or another all the time; it's no big deal. Just follow https://3ds.guide/restoring-updating-cfw.