inotocracy
Supreme [H]ardness
- Joined
- Jul 25, 2004
- Messages
- 5,625
So there is this library in Java, Blowfishj which has a class called BlowfishEasy. It essentially removes any complication from encrypting a string, but it also adds a bit of complexity (and anger) if you have to decrypt this string using a different language since the BlowfishEasy implementation pushes the IV into the front of the encrypted result. The problem is, I have to take some encrypted data generated by BlowfishEasy and decrypt it in a different language, which means a different Blowfish library. Normally this wouldn't be an issue, but since the client is using BlowfishEasy it is. I've tried to pull the IV out of the encrypted string but I'm having NO luck. Any Java gurus here with PHP experience mind helping me out on this?
Here is the blowfisheasy class:
https://opensource.at.northwestern....ce/encryption-src/BlowfishJ/BlowfishEasy.java
On line 107 you'll notice that the IV is randomly generated in the encryption call, and then on line 148 it returns the IV + the result as one string. Now in the decrypt call, on line 169 it calls binHexToBytes which extracts the IV from the encrypted string. The method is near the bottom of this source file:
https://opensource.at.northwestern....ce/encryption-src/BlowfishJ/BinConverter.java
What I want to do is be able to extract that IV from the encrypted string (that was generated by BlowfishEasy) so that I can decrypt it properly in a different library/language. The language I need to do the decryption is in PHP. Any code examples or guides on how to do this would be fan-fuggin-tastick as I'm pulling my hair out here.
Here is the blowfisheasy class:
https://opensource.at.northwestern....ce/encryption-src/BlowfishJ/BlowfishEasy.java
On line 107 you'll notice that the IV is randomly generated in the encryption call, and then on line 148 it returns the IV + the result as one string. Now in the decrypt call, on line 169 it calls binHexToBytes which extracts the IV from the encrypted string. The method is near the bottom of this source file:
https://opensource.at.northwestern....ce/encryption-src/BlowfishJ/BinConverter.java
What I want to do is be able to extract that IV from the encrypted string (that was generated by BlowfishEasy) so that I can decrypt it properly in a different library/language. The language I need to do the decryption is in PHP. Any code examples or guides on how to do this would be fan-fuggin-tastick as I'm pulling my hair out here.