M
MD
Hello,
i'm using the OpenNETCF.org framework so send encrypted data from a
Pocket PC to a server.
I neeed to send the encrypted data as a String and then decrypt it.
The code:
// encode data
Byte[] encodedBytes =
des.EncryptValue(System.Text.Encoding.ASCII.GetBytes(data));
String encodedBytesAsString =
System.Text.Encoding.ASCII.GetString(encodedBytes, 0,
encodedBytes.Length);
// send data
byte[] encodedBytes2 =
System.Text.Encoding.ASCII.GetBytes(encodedBytesAsString);
byte[] decodedBytes = des.EncryptValue(encodedBytes2);
String decodedBytesAsString =
System.Text.Encoding.ASCII.GetString(decodedBytes, 0,
decodedBytes.Length);
The decryption doesn't work.
Does anyone have an idea? Does it has to do something with the ASCII
conversion?
MD
i'm using the OpenNETCF.org framework so send encrypted data from a
Pocket PC to a server.
I neeed to send the encrypted data as a String and then decrypt it.
The code:
// encode data
Byte[] encodedBytes =
des.EncryptValue(System.Text.Encoding.ASCII.GetBytes(data));
String encodedBytesAsString =
System.Text.Encoding.ASCII.GetString(encodedBytes, 0,
encodedBytes.Length);
// send data
byte[] encodedBytes2 =
System.Text.Encoding.ASCII.GetBytes(encodedBytesAsString);
byte[] decodedBytes = des.EncryptValue(encodedBytes2);
String decodedBytesAsString =
System.Text.Encoding.ASCII.GetString(decodedBytes, 0,
decodedBytes.Length);
The decryption doesn't work.
Does anyone have an idea? Does it has to do something with the ASCII
conversion?
MD