Google allows you to create a “secure token” for reCAPTCHA, which means that you can use the same key / secret for multiple domains. No need to create a key / secrets for each domain you are looking at.
Here, their documents, as you can see, have no idea how the token is encrypted, except for an example in Java . My question is how this will be written in ColdFusion. I had a crack for 4 hours, but I just can't get it to work. Other examples I reviewed:
Any ColdFusion encryption guru knows how to do this?
UPDATE
Thank you, Lee, think that we are moving on, but still see an “invalid runoff”. Here is what I have:
json_token = '{"session_id":"#createUUID()#","ts_ms":#dateDiff("s", dateConvert("utc2Local", "January 1 1970 00:00"), now())#}'; secret_key_hash = hash(secret_key,"SHA", "UTF-8"); secret_key_binary = binaryDecode(secret_key_hash, "hex"); secret_key_aes = arraySlice(secret_key_binary,1,16); secret_key_base64 = binaryEncode( javacast("byte[]", secret_key_aes), "base64"); secure_token = Encrypt(json_token,secret_key_base64,"AES/ECB/PKCS5Padding",'base64');
We use ColdFusion 9 on Java 1.7, the arraySlice method is not available or the underlying java.subList (). So we are using arraySlice UDF from cflib.org.
I also saw comments on the PHP implementation about URL encoding, so I also tried this at the end, with no effect:
secure_token = Replace(secure_token,"=","","ALL"); secure_token = Replace(secure_token,"+","-","ALL"); secure_token = Replace(secure_token,"/","_","ALL");