Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can I encrypt ascii extended codes using Rijndael 1

Status
Not open for further replies.

tango1948

Programmer
Dec 23, 2006
111
IL
Hi I have a couple of questions, firstly am I correct in assuming that the Rijndael encrytion method cannot handle ASCII extended codes (> 127).
Secondly if this is so I want to convert ASCII code characters 128 - 154 (Hebrew Dos) to 97 - 123 (Lower case + 1). The string.Replace function doesn't seem to work, I assume because it's looking for unicode characters. So what function can I use to replace these ASCII characters in the string or alternativly which encryption methods will handle ASCII extended codes.
Thanks for any help

David
 
Rjindael will have no problems encrypting any byte value you give it -- [0..255] will all work in both directions.

However, the ASCII encoding is only defined for the range of [0..127], and so any characters that are above that range will not be retrieved correctly.

The clue is that you're referring to Hebrew and ASCII in the same context, and they are not the same thing. Investigate the System.Text.Encoding.GetEncoding() method, and use the encoder it returns you prior to encrypting your string.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top