tags:

views:

48

answers:

1

Hi,

I have made a C# application that talks to my website via PHP(mcrypt) and visa versa.

I was wondering which is the best cipher to use and if there are any ciphers that are tempermental when encrypt/decrypting over different lanuages.

I also wondered if I need to convert the data to a different format before encrypting.

E.g. Say I am encrypting with PHP do I need to convert the data to ASCII before I encrypt it. Just to make sure I dont get stuck for ages over format ;)

Thanks

+1  A: 

There is no "best" cipher but I would recommend using an encryption algorithm that has been used a lot like Tripple Des or AES.

The content of the target string shouldnt be effected by the type of encryption since they operate at the byte level not the encoding level.

bleevo
Thanks for that bleevo. Could you tell me the best mode to use. I have been doing a bit of reading on CBC but still am unsure. The data I will be encrypting would only be a few KB's in size. Would this be the most secure?Thanks again
arbme
Encoding format can be critical if strings are involved. Use UTF-8 to go from strings to bytes and back again.
GregS
As long as you are encoding/decoding byte arrays the encoding format isnt important. If you however use a different encoding format on each side thats a different story however thats got nothing to do with the crypto but encoding.The question is whats the best way to have crypto interop between C# and PHP, the answer is use the same encoding and crypto scheme.
bleevo
@GregS So strings->uft->bytes->encrypt? thanks
arbme
@bleevo Thanks but should i use CBC mode is it more secure then the others?
arbme
All encryption is only as strong as how secure your key is. Again it depends on what your doing etc and how secure you need it to be.
bleevo