working version of encryptor