Easy Encryption and Decryption

Asked at General Motors · Coding Questions · Difficulty: Easy

Write an encryption and decryption algorithm. Given a string, encrypt it with a specified offset and then decrypt it back. The encryption uses a simple shift method, like the Caesar cipher. Input is a string and an offset, output is the encrypted string and the original string after decryption. It should handle various character types, including letters, numbers, and punctuation.

Loading the problem…