0

I am currently posting an encrypted string to a ColdFusion web server where I am trying to decrypt the value using the same password used in encrypting it in LiveCode. It isn't working at all, where ColdFusion keeps on telling me that the data to be decrypted is not correct.

When I answer the data posted it is exactly the same as what the coldfusion server receives it as.

In Coldfusion I use:

<cfset decrypted=decrypt(#dataposted#, #password#,'AES')> 

In Livecode I use:

encrypt gFirstName using "aes256" with password tPassword 

(Both passwords are the same in each script).

Any ideas?

Mark
  • 2,380
  • 11
  • 29
  • 49
user2429578
  • 111
  • 1
  • 10
  • Do you want [DecryptBinary](https://wikidocs.adobe.com/wiki/display/coldfusionen/DecryptBinary) instead? i.e. `decryptBinary(dataposted,password,'AES')` (Note the lack of hashes - they are not needed for function arguments.) – Peter Boughton Mar 19 '14 at 11:49
  • 2
    Also you haven't mentioned the CF version (7/8/9/10) and edition (Standard/Enterprise) - these are relevant to what algorithms CF supports. – Peter Boughton Mar 19 '14 at 11:50
  • 1
    It would help to see an example using a dummy key, but a few additional thoughts: A) using 256 bit keys requires installing the [(JCE) Unlimited Strength Jurisdiction Policy](http://stackoverflow.com/a/21191973/104223) first. Did you do that? B) The previous example uses "CBC" mode which requires an `iv`. If you are using CF's default mode "ECB", it is not required. Do you have a link to the API? Specifically we need to know what "mode" and "padding scheme" LiveCode uses. C) What is the format of your "password" string? CF requires keys to be base64 encoded strings. – Leigh Mar 19 '14 at 14:35
  • 1
    Also, please include the *actual* error message, rather than a description of it. – Leigh Mar 19 '14 at 15:16

1 Answers1

0

Coldfusion decrypt need a key, not a password, so the correct livecode code is:

encrypt gFirstName using "aes256" with key tPassword
MaxV
  • 588
  • 1
  • 4
  • 13