troubleshooting Question

Exchange encrypted strings with c++ and PHP (Web)

Avatar of xNejX
xNejXFlag for Canada asked on
20 Comments1 Solution1382 ViewsLast Modified:

I’m trying to exchange / send an encrypted string from my c++ software to a web script running in PHP. The C++ software encrypts the string and the Web uses PHP to decrypt it and store it in the DB.

But i have a problem. Every time i try to send the string to my web script the decryption is incorrect. Both of the environments’ (C++, PHP) have been tested to successfully encrypt and decrypt their own strings which are made locally. I think that something gets lost in the transaction as the characters of the encrypted string are something like this.  y ½Ô^ Ô Q³4N8@4Ð|÷à    ˆ¸
‘€‡  and I already tried to BASE64 encode it during the transaction and I also tried to HEX encode the string during the transaction but it didn’t help. I’m currently trying URL encode but I doubt that it's going to help.

The PHP script is using UTF-8 encoding, the character set in the c++ software is "Use Multi-Byte Character Set",

How can I ensure to successfully transport the encrypted string to my Web Script so it can be decrypted? How do you guys do it?

When comparing the encrypted string in C++ and the received encrypted string in PHP I can see that some unusual special characters get changed to ? or something like that while the majority of the encrypted string remains the same.

Thank you for your help,
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 20 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 20 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros