Adding basic logic to encrypt and decrypt