title: Symfony 2 - WSSE - FOSUserBundle - FOSRestBundle - Javascript
body: <p>I try to incorporate WSSE Authentification. I have a symfony in back, and an app Ionic - AngularJS in front.
  I followed the cookbook about WSSE, and theses tutorials :</p>
  
  <p><a href="http://obtao.com/blog/2013/05/create-rest-api-in-a-symfony-application/" rel="nofollow">http://obtao.com/blog/2013/05/create-rest-api-in-a-symfony-application/</a></p>
  
  <p><a href="http://obtao.com/blog/2013/06/configure-wsse-on-symfony-with-fosrestbundle/" rel="nofollow">http://obtao.com/blog/2013/06/configure-wsse-on-symfony-with-fosrestbundle/</a></p>
  
  <p>And </p>
  
  <p><a href="http://obtao.com/blog/2013/09/how-to-use-wsse-in-android-app/" rel="nofollow">http://obtao.com/blog/2013/09/how-to-use-wsse-in-android-app/</a></p>
  
  <p>I install WSSE well, i can hash my password in my app with this code: </p>
  
  <pre><code>authentication.hashPassword = function(salt, clearPassword) {
    var digest = "";
    console.log('==== STARTING HASHING PASSWORD ====');
    var salted = null;
    if (!salt || salt == "") {
      salted = clearPassword;
    } else {
      salted = clearPassword + "{" + salt + "}";
    }
    digest = CryptoJS.SHA512(salted);
    for (var i=1; i&lt;5000; i++) {
      digest = CryptoJS.SHA512(digest.toString(CryptoJS.enc.Latin1)+salted);
    }
    digest = digest.toString(CryptoJS.enc.Base64);
    console.log('==== ENDING HASHING PASSWORD ====');
    console.log(digest);
    return digest;
  };
  </code></pre>
  
  <p>but i would like to generate header with my hash password ( the last tutorial is coded in java, and i'm a noob in Java)</p>
  
  <p>Is it Possible to compare two hash password if i post my hash password ?</p>
  
  <p>have you any idea to create a header ( or Token ) ?</p>
  
  <p>Thank you for your answer</p>