title: Encrpyting AES in my mobile App blocks the UI
body: <p>I have an app built with angular angular stateprovider/phonegap and ionic with the ionic seed. I do make REST requests to a server to receive data needed in my views. Every request needs a control token which is encrypted with aes. So generally: I want to do the encryption asynchronous so the ui won't block (the encryption takes on some mobile devices up to eight seconds, which results to a ui-freeze or long loading time after app startup). Timeout is not an option for me because I don't know how long the encryption takes on a specific device. </p>
  
  <p>An option would be using <a href="https://developer.mozilla.org/en/docs/Web/Guide/Performance/Using_web_workers" rel="nofollow">web workers</a> (But I don't think older devices are supporting this... ) </p>
  
  <p>I also tried <code>$scope.$evalAsync()</code>, but this is executed at any time...</p>
  
  <p>What do you think about solving that problem?</p>
  
  <p>Greetings.
  P.S: the part of my controller for the view (the encryption is made where the <code>$resource.query()</code> is triggered):</p>
  
  <pre><code>    $scope.resource = {};
      $scope.loadProjects = function(){
      $scope.resource.projects = RProject.query();
      $scope.resource.projects.$promise.then(function(data){
  
          for(var i = 0; i &lt; data.length; i++)
              //create project title mapping model for item project id
              $scope.view.projectTitleListMap[data[i].project_id] = data[i].project_title;
  
      });
  
  };
  
  $scope.$evalAsync($scope.loadProjects());
  </code></pre>