Schneider Electric interview question

wrte a string encoder to encrypt a given string