Domanda di colloquio di Hitachi Vantara

Write a function to encrypt a string based on the shift integer.