By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,730 Members | 1,156 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,730 IT Pros & Developers. It's quick & easy.

How to encrypt to xxxx-xxxx-xxxx-xxxx

P: n/a
Hi!

Are there any built in classes (or methods) in the framework that can
encrypt to some simple string like the one you enter when registring an
Microsoft application (xxxx-xxx-xxxx-xxxx)?
I have tried using i.e. DESCryptoServiceProvider (and other) and
ConvertToBase64String but these strings gets quite long and complicated.

Thanks in advance
/Henke
Nov 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
What you could look into is a Base32 encoding, which will be more compact
than hex, but be case-insensitive.

The length is related to the block size of the cipher (the .NET Framework
only has block ciphers). DES is 64-bit, so in Base32, that's gonna be 13
chars. Not too bad (DES is probably strong enough for keycodes, since an
app can be cracked anyways). Decent algorithms (like Rijndael) is going to
have a 128-bit block (for AES), 26 chars. Somewhat longer, but I think the
MS keys are the same size (or near that).

On my site (www.atrevido.net) I just posted a sample Base32 encoding. This
does not follow a standard Base32 encoding, but instead a modified one I've
used for keycodes, removing certain chars that are easily confused. You can
google for Base32 and get other implementations and find the standard.

As far as delimiting the sections with dashes, that's completely up to how
you want to do that. You could also add a check-character for every group
(as I believe the MS keycodes have).

-mike
MVP

"Henke" <he********@hotmail.com> wrote in message
news:Oa**************@tk2msftngp13.phx.gbl...
Hi!

Are there any built in classes (or methods) in the framework that can
encrypt to some simple string like the one you enter when registring an
Microsoft application (xxxx-xxx-xxxx-xxxx)?
I have tried using i.e. DESCryptoServiceProvider (and other) and
ConvertToBase64String but these strings gets quite long and complicated.

Thanks in advance
/Henke

Nov 22 '05 #2

P: n/a
Thanks Michael, now I know what those Base64Strings are.
/Henke

"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> skrev i meddelandet
news:%2****************@TK2MSFTNGP09.phx.gbl...
What you could look into is a Base32 encoding, which will be more compact
than hex, but be case-insensitive.

The length is related to the block size of the cipher (the .NET Framework
only has block ciphers). DES is 64-bit, so in Base32, that's gonna be 13
chars. Not too bad (DES is probably strong enough for keycodes, since an
app can be cracked anyways). Decent algorithms (like Rijndael) is going to have a 128-bit block (for AES), 26 chars. Somewhat longer, but I think the MS keys are the same size (or near that).

On my site (www.atrevido.net) I just posted a sample Base32 encoding. This does not follow a standard Base32 encoding, but instead a modified one I've used for keycodes, removing certain chars that are easily confused. You can google for Base32 and get other implementations and find the standard.

As far as delimiting the sections with dashes, that's completely up to how
you want to do that. You could also add a check-character for every group
(as I believe the MS keycodes have).

-mike
MVP

"Henke" <he********@hotmail.com> wrote in message
news:Oa**************@tk2msftngp13.phx.gbl...
Hi!

Are there any built in classes (or methods) in the framework that can
encrypt to some simple string like the one you enter when registring an
Microsoft application (xxxx-xxx-xxxx-xxxx)?
I have tried using i.e. DESCryptoServiceProvider (and other) and
ConvertToBase64String but these strings gets quite long and complicated.

Thanks in advance
/Henke


Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.