You don’t even need ML. Let’s say you use some standard encryption routine to turn text into a string of numbers.
You could then use those numbers as an index into another text corpus, let’s say a known copy of the Bible.
The only hiccup would be to make sure each verse is unique so you can decrypt properly.