I'm facing a problem with converting the following string the result of php is different from c#
please note that the text and $text = "Salted__12345678 �V�*>�����ܛ��(\˖��\�Zf�`��ȯE��I�W��0�Җ0���z������"
now in c#
byte[] Opencipher = **** ;
string utfString = Encoding.UTF8.GetString(Opencipher, 0, Opencipher.Length);
string text = "Salted__12345678" + utfString // here it match the $text in php
byte[] plainTextBytes = System.Text.Encoding.UTF8.GetBytes(text);
return System.Convert.ToBase64String(plainTextBytes);
the result is
U2FsdGVkX18xMjM0NTY3OA3vv70LVg/vv71/Kj7vv73vv73vv73vv73vv73cm++/ve+/vShcy5YH77+977+9XO+/vVpmEe+/vQUcYBXvv73vv73Ir0Xvv73vv71J77+9V++/vQPvv70w77+90pYw77+977+977+9egLvv73vv73vv73vv73vv73vv70=
when I use PHP
// $ct is a byte array or salt key
$text = "Salted__" . $ct // here it match the text in c#
base64_encode($text);
the result is
U2FsdGVkX18xMjM0NTY3OA2rC1YP+38qPqenpI/d3Ju9xChcy5YHotxcjlpmEbUFHGAV6PXIr0WEi0ndV9gDvTCb0pYwte7WegK4i+L1neE=
but when I'm using c#
I tried all the Encoding types (UTF8, UTF7, Default ... etc) but it doesn't work
I think the problem here that PHP accept concatenate between string and Byte[]
and c# encoding is different from PHP when there are spacial carachters
the PHP code is correct but I need to get the same results from c# code
Thank you