I want to encrypt data using PHP and store it in SQL database having a field in varchar and then decrypt in Node js and process it. What should be the encryption, I tried with openssl_encrypt but not able to decrypt in Node js tried with aes-js module.
Asked
Active
Viewed 83 times
0
-
what do you want to encrypt? – Raymond Nijland May 19 '18 at 21:49
-
A list of FCM server keys using PHP and Decrypt it using Nodejs as our backend is created in Nodejs. – Debashish Kumar May 19 '18 at 21:57
-
1This is too broad. There is no "best algorithm". Ask about a specific issue and post your code. – Luke Joshua Park May 19 '18 at 22:00
-
Ok, then I want to know the easy way to encrypt the FCM server keys using PHP and decrypt the same keys by using Node Js. How to achieve that? – Debashish Kumar May 19 '18 at 22:05
-
AES is probably the easiest because it's most widely supported. I say again, post your code, show what you've tried. – Luke Joshua Park May 19 '18 at 22:08
-
PHP code generates encrypted data http://phpfiddle.org/main/code/nurm-t0jf I am tring to decrypt with https://www.npmjs.com/package/aes-js but not able to acheive yet. – Debashish Kumar May 19 '18 at 22:25
-
2Yeah... You should edit your question to include the code you've tried in both languages. We don't write code for you. – Luke Joshua Park May 19 '18 at 22:28
1 Answers
0
Thanks, Luke for trying to help me I got the answer in another post in StackOverflow, I am sharing the link so, that if anyone facing this problem like me can reuse the code. Encrypt with PHP, Decrypt with Javascript (cryptojs)

Debashish Kumar
- 43
- 9