angularjs-crypto icon indicating copy to clipboard operation
angularjs-crypto copied to clipboard

encrypted data with default settings doesnt work out in php backend

Open gorkagb opened this issue 9 years ago • 2 comments

Hi

We have integrated the plugin in an angularjs/phonegap build hybrid mobile app. The interceptor takes care of the requests and correctly encrypts the parameters values but when we try to descrypt the data in the server it doesnt work out.

We have tried multiple options with no succes. For example, with openssl_decrypt($data, 'aes-128-ecb', $jçkey, OPENSSL_RAW_DATA); openssl_decrypt($data, 'aes-192-ecb', $jçkey, OPENSSL_RAW_DATA); openssl_decrypt($data, 'aes-256-ecb', $jçkey, OPENSSL_RAW_DATA); which uses the default padding, supposed to be Pkcs7, but we dont get any results.

What kind of settings do we need to use at backend to be able to process the encrypted data by the default settings of the plugin (AES, ECB and Pkcs7)?

gorkagb avatar May 19 '16 09:05 gorkagb

I think we found the problem, changed cipher to DES3 and we also needed to decode the key Using AES still doesnt work

gorkagb avatar May 19 '16 11:05 gorkagb

The encrypt/decrypt works both sides but if the message is longer than 8 characters it fails. Is there any limitation for default settings or specific iv param that i´m not aware of and is causing the problem?

gorkagb avatar May 21 '16 08:05 gorkagb