views:

71

answers:

3

I have a php script creating an encoded value, for example:

m>^æ–S[J¯vÖ_ÕÚuÍÔ'´äœÈ‘ ®@M©t²#÷[Éå¹UçfU5T°äÙ“©”ˆÇVÝ] [’e™a«Ã°7#dÉJ>

I then need to decode this in a vb.net application The problem is that value above can have any characters. And VB.net can't handle it:

dim strCryptedString As String = 'm>^æ–S[J¯vÖ_ÕÚuÍÔ'´äœÈ‘ ®@M©t²#÷[Éå¹UçfU5T°äÙ“©”ˆÇVÝ] [’e™a«Ã°7#dÉJ>"

So any suggestions how to deal with that value?

+6  A: 

Try base64encode and base64decode. That may be all that you need!

Fiarr
Thank you very much. That worked out like a charm. Now I have to work on the Decryption part.Thank you.
shaiss
Awesome, glad it worked!
Fiarr
A: 

If you actually need to have it written out in your VB.net source code, you could try base64 encoding it:

dim strCryptedString As String = Base64Decode('bT5ew6bigJNTW0rCr3bDll/DlcOadcONw5QnwrTDpMWTw4jigJggwq5ATcKpdMKyI8O3W8OJw6XCuVXDp2ZVNVTCsMOkw5nigJzCqeKAncuGw4dWw51dIFvigJll4oSiYcKPwqvDg8KwNyNkw4lKPg==');

I'm not sure what the library functions' real names are.

too much php
A: 

When you read the string, read it into a byte array instead of a string. Then use the numeric value for the characters when you do the decoding.

xpda