title: What is the correct way to configure a spring TextEncryptor for use on Heroku
body: <p>I have a spring TextEncryptor defined like this</p>
  
  <pre><code>&lt;bean id="textEncryptor" class="org.springframework.security.crypto.encrypt.Encryptors"
                                                    factory-method="text"&gt;
          &lt;constructor-arg value="${security.encryptPassword}" /&gt;
          &lt;constructor-arg value="${security.encryptSalt}" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Which is fed these properties</p>
  
  <pre><code>security.encryptPassword=47582920264f212c566d5e5a6d
  security.encryptSalt=39783e315e6a207e733d6f4141
  </code></pre>
  
  <p>Which works fine on my local environment. When I deploy to Heroku I get </p>
  
  <pre><code>java.lang.IllegalArgumentException: Unable to initialize due to invalid secret key
  at org.springframework.security.crypto.encrypt.CipherUtils.initCipher(CipherUtils.java:110)
  at org.springframework.security.crypto.encrypt.AesBytesEncryptor.encrypt(AesBytesEncryptor.java:65)
  at org.springframework.security.crypto.encrypt.HexEncodingTextEncryptor.encrypt(HexEncodingTextEncryptor.java:36)
  ...
  Caused by: java.security.InvalidKeyException: Illegal key size
  at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:972)
  at javax.crypto.Cipher.implInit(Cipher.java:738)
  at javax.crypto.Cipher.chooseProvider(Cipher.java:797)
  at javax.crypto.Cipher.init(Cipher.java:1276)
  at javax.crypto.Cipher.init(Cipher.java:1215)
  at org.springframework.security.crypto.encrypt.CipherUtils.initCipher(CipherUtils.java:105)
  ... 53 more
  </code></pre>
  
  <p>So I tried some smaller keys but I always get the same problem. What is the correct key size to use on Heroku?</p>