Varghjärta Posted October 25, 2005 Posted October 25, 2005 Hey peeps! Alright my problem is as follows, for whatever reason I may have (a clever one trust me :) ) I _need_ to be able to open up binary files(or text, but binary should be faster so i'm going with that) containing encrypted text in Unicode. My problem is more specifically that in my recent try runs I've been unable to encrypt a file from C# and then via PHP decrypt it. The stuff I get back from php is just mumbojumbo (same key has been used). I've attempted this with the Blowfish algorithm, one that I found to .net and one which I found to PHP. NOW, correct me if i'm wrong but shouldn't the 'same' algorithm be able to open whatever data made by any software as long as it's _that_ algorithm.. is not Blowfish == Blowfish?? Any ideas? I would also appreaciate any pointers to other algorithms that _should_ work and exists to both c# and php, but I'd prefer to use the ones I have counted on for many years. Which is mainly Blowfish, Twofish & Rijndael (in that order) and I count them as very strong and safe. Thanks in advance! Quote
mark007 Posted October 25, 2005 Posted October 25, 2005 I can't say I know much about the algorithm but it would be useful to see how you are encrypting and attempting to decrypt. It may be a case of different default being used to seed part of the encryption. Quote Please check the Knowledge Base before you post. "Computers are useless. They can only give you answers." - Pablo Picasso The Code Net
Varghjärta Posted October 26, 2005 Author Posted October 26, 2005 Well, I stole the php blowfish from: http://pear.php.net/package/Crypt_Blowfish And in c# I used "XCrypt" from : http://www.codeproject.com/csharp/XCrypt.asp Now, it has come to my attention that it's no guarantee that different implementations of blowfish will be cross-compatible. But then, I need to find one that _is_ for php+c# *sigh This kind of feels impossible, now if only I had c# support on my webhost I could have used the same dll. Quote
mark007 Posted October 26, 2005 Posted October 26, 2005 Well you need to compare the code of the 2. I don't have a login at the code project so cannot download the spurce for the c# implementation. In particular you need to check that they use the same initialisation params. Quote Please check the Knowledge Base before you post. "Computers are useless. They can only give you answers." - Pablo Picasso The Code Net
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.