How can I get an MD5 hash in ColdFusion?
I'm trying to get an MD5 hash of a value in ColdFusion using the [Encrypt][1] function<sup>1</sup>.  I tried this code:

    <cfscript>
    val = 1117;
    md5 = Encrypt(val, 0, "MD5", "Hex");
    </cfscript>

But I get an error:

> The MD5 algorithm is not supported by the Security Provider you have chosen.

How can I choose a different security provider?

---

Alternatively, I know ColdFusion can run Java code but I've never really done it.  Could someone tell me how I could write this Java code (which I found [here][2]) from ColdFusion:

    try {
      MessageDigest md = MessageDigest.getInstance("MD5"); 
      md.update(ByteBuffer.allocate(4).putInt(1117));
      System.out.println("MD5: "+new BigInteger(1,md.digest()).toString(16));
    } catch (NoSuchAlgorithmException e) {}

---

<sup>1</sup> Yes, I know that MD5 isn't an *encryption* algorithm, but the ColdFusion folks don't seem to know that because they list it as a supported algorithm for the Encrypt function.


  [1]: http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_e-g_01.html
  [2]: http://snippets.dzone.com/posts/show/3686
How can I get an MD5 hash in ColdFusion?
===

I'm trying to get an MD5 hash of a value in ColdFusion using the [Encrypt][1] function<sup>1</sup>.  I tried this code:

    <cfscript>
    val = 1117;
    md5 = Encrypt(val, 0, "MD5", "Hex");
    </cfscript>

But I get an error:

> The MD5 algorithm is not supported by the Security Provider you have chosen.

How can I choose a different security provider?

---

Alternatively, I know ColdFusion can run Java code but I've never really done it.  Could someone tell me how I could write this Java code (which I found [here][2]) from ColdFusion:

    try {
      MessageDigest md = MessageDigest.getInstance("MD5"); 
      md.update(ByteBuffer.allocate(4).putInt(1117));
      System.out.println("MD5: "+new BigInteger(1,md.digest()).toString(16));
    } catch (NoSuchAlgorithmException e) {}

---

<sup>1</sup> Yes, I know that MD5 isn't an *encryption* algorithm, but the ColdFusion folks don't seem to know that because they list it as a supported algorithm for the Encrypt function.


  [1]: http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_e-g_01.html
  [2]: http://snippets.dzone.com/posts/show/3686