How to decode interstellar messages