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?

shaiss
  • 2,000
  • 5
  • 22
  • 33

3 Answers3

6

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

Fiarr
  • 858
  • 5
  • 16
  • Thank you very much. That worked out like a charm. Now I have to work on the Decryption part. Thank you. – shaiss Aug 14 '09 at 16:54
1

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
  • 88,666
  • 34
  • 128
  • 138
0

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
  • 15,585
  • 8
  • 51
  • 82