Learning to decode encrypted documents