finished a code that can encrypt and decrypt strings