Cryptography on .net CF

W

Wrecked

hello,
I am a bit new to .net and .net CF. My doubt is wether
System.Security.Cryptography is also supported in CF.

when i include the following code in a normal project and built it..
it didnt give me any errors


using System;
using System.Security.Cryptography;


namespace Encrypt
{
public class Encrypt
{
public byte[] MsgDigest5(byte[] msg)
{
byte[] data = msg;
MD5 md5 = new MD5CryptoServiceProvider();
byte[] result = md5.ComputeHash(data);
return result;
}
}
}


however when i include the above code for a windows smart phone device
(CF) and built, it tells me "The type or namespace name 'MD5' could
not be found (are you missing a using directive or an assembly
reference?) ". Does this mean that MD5 is not supported in .net cf or
is there anything wrong with the code i have written.

Thanks and Regards
Rithesh
 
S

Simon Hart

You didn't say what version of the CF you are using, but from what you are
saying I am assuming CF 1.0.

MD5 is not supported in CF 1.0 but is supported under CF2.0.

See here for supported members under CF2.0:
http://msdn2.microsoft.com/en-us/library/system.security.cryptography.md5_members.aspx

If you must use CF1.0, then I recommend looking at the
OpenNETCF.Security.Cryptography namespace as there is very limited support
for Cryptography in CF 1.0.

Regards
Simon.
 
W

Wrecked

Hello Simon,
Thanks a lot for that info. I upgraded my project to 2.0 and
its working fine now. It would also be very kind of you if u could let
me know if RC4 (again its cryptography stuff) is available in 2.0. I
did search a bit on my own but i could only find RC2.

Thanks and Regards,
Rithesh Swamy


Simon said:
You didn't say what version of the CF you are using, but from what you are
saying I am assuming CF 1.0.

MD5 is not supported in CF 1.0 but is supported under CF2.0.

See here for supported members under CF2.0:
http://msdn2.microsoft.com/en-us/library/system.security.cryptography.md5_members.aspx

If you must use CF1.0, then I recommend looking at the
OpenNETCF.Security.Cryptography namespace as there is very limited support
for Cryptography in CF 1.0.

Regards
Simon.

Wrecked said:
hello,
I am a bit new to .net and .net CF. My doubt is wether
System.Security.Cryptography is also supported in CF.

when i include the following code in a normal project and built it..
it didnt give me any errors


using System;
using System.Security.Cryptography;


namespace Encrypt
{
public class Encrypt
{
public byte[] MsgDigest5(byte[] msg)
{
byte[] data = msg;
MD5 md5 = new MD5CryptoServiceProvider();
byte[] result = md5.ComputeHash(data);
return result;
}
}
}


however when i include the above code for a windows smart phone device
(CF) and built, it tells me "The type or namespace name 'MD5' could
not be found (are you missing a using directive or an assembly
reference?) ". Does this mean that MD5 is not supported in .net cf or
is there anything wrong with the code i have written.

Thanks and Regards
Rithesh
 
S

Simon Hart

There is no such class as RC4 in either the full framework or CF.

Regards
Simon.

Wrecked said:
Hello Simon,
Thanks a lot for that info. I upgraded my project to 2.0 and
its working fine now. It would also be very kind of you if u could let
me know if RC4 (again its cryptography stuff) is available in 2.0. I
did search a bit on my own but i could only find RC2.

Thanks and Regards,
Rithesh Swamy


Simon said:
You didn't say what version of the CF you are using, but from what you
are
saying I am assuming CF 1.0.

MD5 is not supported in CF 1.0 but is supported under CF2.0.

See here for supported members under CF2.0:
http://msdn2.microsoft.com/en-us/library/system.security.cryptography.md5_members.aspx

If you must use CF1.0, then I recommend looking at the
OpenNETCF.Security.Cryptography namespace as there is very limited
support
for Cryptography in CF 1.0.

Regards
Simon.

Wrecked said:
hello,
I am a bit new to .net and .net CF. My doubt is wether
System.Security.Cryptography is also supported in CF.

when i include the following code in a normal project and built it..
it didnt give me any errors


using System;
using System.Security.Cryptography;


namespace Encrypt
{
public class Encrypt
{
public byte[] MsgDigest5(byte[] msg)
{
byte[] data = msg;
MD5 md5 = new MD5CryptoServiceProvider();
byte[] result = md5.ComputeHash(data);
return result;
}
}
}


however when i include the above code for a windows smart phone device
(CF) and built, it tells me "The type or namespace name 'MD5' could
not be found (are you missing a using directive or an assembly
reference?) ". Does this mean that MD5 is not supported in .net cf or
is there anything wrong with the code i have written.

Thanks and Regards
Rithesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top