Encryption Problem on Windows with diff System Locales 
Author Message
 Encryption Problem on Windows with diff System Locales

folks,

I got a problem. Pls help. The problem arises in an encrpytion functions.
When I encrypt a text and decrypt it using the codes on Eng Windows,
everything is going great. Say, I encrypt a character "r", and i then
decrypt it, it returns "r". But when i run the code on Chinese Windows, and
I encrpt a string "r", and then I decrypt it. The "r" cannot be returned.
The problem occurs is in one of the functions in the encryption part of my
program. It is shown below:

Function Hex2Str(InpHex$) As String
    'Convert Hex strings (eg. "00123ADBBE") to Character strings
    For i = 1 To Len(InpHex$) Step 2
        Temp1$ = Chr$(Val("&H" + Mid$(InpHex$, i, 2)))
        Temp2$ = Temp2$ + Temp1$
    Next i
    Hex2Str = Temp2$
End Function

The Temp1$ is different when I run it on Eng and Chinese Windows
respectively. I know that the codepage in these two locale is different, but
how should i solve the problem? I want to make the Temp1$ the same as Eng
Windows even if i run it on the Chinese Windows Platform or other Windows
with different System Locale. I tried to use the ChrW function to replace
Chr$, but it is the same case. guys, pls help. Many Many thanks.

Bryan



Sun, 28 Dec 2003 19:57:12 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Example of encryption using WET (Windows Encryption Toolkit)?

2. Encryption problem in CHINESE WINDOWS

3. Getting a standard ASCII date string independent of system locale

4. Getting a standard ASCII date string independent of system locale

5. Getting a standard ASCII date string independent of system locale

6. Need to change Locale system settings.

7. How do I know locale setting of Time and Date of current system

8. About System Locale.............

9. getLocale in Internet Explorer does not return locale of Windows

10. getLocale in Internet Explorer does not return locale of windows

11. ADODB Connection String- Two Diff Examples - Two Diff Errors

12. String encryption function... using System.Security.Cryptography

 

 
Powered by phpBB® Forum Software