views:

186

answers:

1

Is there any encryption and decryption Algorithms that work for both php and c#? Please I need a sample codes

A: 

I think what you are looking for is DES3 encoding which can work fairly easily between C# and PHP. Check out these two links for code examples.

C# Example:

http://www.csharper.net/blog/library_encrypt_and_decrypt_methods_using_tripledes_and_md5.aspx

PHP Example

http://us3.php.net/manual/en/mcrypt.examples.php

angryCodeMonkey
AES (Rijndael) would be a better choice.
Will Vousden
thanks Shane are you saying this will work with both c# and php? C# sample codes is fine I am c# developer but I don't know which one to use in PHP sample codes.
james
Did I need a special library to run php on windows vista environment. I can write simple message like echo "hello" but whenever I try to run any these scripts no error nothing display on the page http://php.net/manual/en/function.crypt.php. I'm new to PHP please help
james
@james - What environment are you running on Windows Vista? If you aren't using it I highly suggest using XAMPP (I use this extensively for my windows development environment). I have never had a problem with encryption routines using XAMPP.
angryCodeMonkey