Script error

i have error when i want var encrypted got Identifier ‘encrypted’ has already been declared

      let encrypted = cipher.update(f, 'utf8', 'base64');
      var encrypted = cipher.final('base64');

      return encrypted;

try This

var encrypted = cipher.update(f, 'utf8', 'base64');
encrypted += cipher.final('base64');

return encrypted;

nothing now got InvocationException: encrypted is not defined