I know Prosody does & I’d put money on ejabberd supporting it too but I’ve not looked it up. You can check compliance for Conversations using compliance.conversations.im which includes message archive management + carbons or use a client that exposes a servers supported XEPs. Yes, it works with encrypted messages.