encrypts a given string