Simple C# encryption in CF

N

Nathan Laff

i'm looking for a very simple encryption / decryption algorithm.
for example a string would be encrypted into a string containing only 6-8
numbers.

Which method would I use here?

Thank you!
 
N

Nathan Laff

not strong. think of every smart phone app registration :) (at least all the
ones i've seen are pretty much the same, small string containing only
numbers based on owner name)

not strong, just a key for a program that will be sold for 1.99.

so, Nathan Laff would encrypt to like 928375
 
I

Ilya Tumanov [MS]

You're probably talking about hash, not encryption. If so, just use
String.GetHashCode().

Encryption would generate data with size proportional to original and can be
decrypted back.

With hash you get a fixed size number which can not be restored back to the
original.



You could use OpenNETCF.Security.Cryptography namespace with NETCF V1.

NETCF V2 has native encryption support in System.Security.Cryptography
namespace.

It also has hashing support.



Best regards,


Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
N

Nathan Laff

How would i use that to create passwords/keys from a string?
seems like that would be pretty easy to crack :)
 
I

Ilya Tumanov [MS]

If you have initial string, yes, that would be easy. But it would be easy no
matter what you use for hashing in this case.

Anyway, you could use, say, industry standard MD5 if you believe it's more
secure.


Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
N

Nathan Laff

yeah, MD5 is a bit more then i needed.

HashCodes seem to be what i want to use, but how would i use this in a
Licence Key scenario?

thanks so much!
 
I

Ilya Tumanov [MS]

You really don't want anybody to know how it works exactly, so it's up to
you to come up with the solution and keep it secret. :)


Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
C

Chris Tacke, eMVP

Easy to crack, but is it worth cracking for $1.99? It's a cost/benefit
analysis.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate
 
G

Guest

It could be as simple as running a 32 bit CRC on the username with a custom
"secret" algorithm as the base instead of a commonly accepted algorithm.
Not overly secure, but easy enough to implement, pretty certain to give a
unique hash for every username, and "secure" enough to keep blatant amateurs
from figuring it out.

-Chris
 

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