Schneider Electric Interview Question

wrte a string encoder to encrypt a given string