I didn’t expect it today, but I finally cracked (for want of a better word) the problem of encrypted communication between Java and PHP.
The problem was that I was not correctly encoding the String data that I was passing to the PHP page, passing either a completely unencoded String of bytes, or a non-url encoded Base64 String that included the invalid characters ‘+’, ‘/’ and or ‘=’.
That’s been sorted now, and the diagram below shows the correct Java code workflow:
So that is Java code encrypting the data with a public key, provided by the PHP server . This encrypted data is then sent securely to the server, which then decodes with the private key. Successfully protected, secure, data.
Quite pleased with this.
Now I just have to plug this in to my licence verification stuff, and DiagramBuilder may soon be ready to go out the door! (Not forgetting stuff like windows/mac installers, ProGuard builds, etc. etc.)