473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to encrypt to xxxx-xxxx-xxxx-xxxx

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
2 3611
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: wqhdebian | last post by:
As far as I know,when encrypt or decrypt ,a key must first be got,and the key is first generate by a tool or from SecurityRandom,that means I can not generate the same key with the same input.Does...
1
by: Benoît | last post by:
Hi, I have generated two keys : "C:>openssl req -nodes -new -x509 -keyout ben.key -out ben.crt -days 3650" I try to encrypt/decrypt a string like "JOHN" with these asymetrics keys. With the...
20
by: Drebin | last post by:
It's a long story really, but the bottom line is we need to encrypt or obfuscate a clear-text 9-digit SSN/taxpayer ID into something less than 21 characters. It doesn't need to be super-secure,...
7
by: Matthias S. | last post by:
Hi, I had a look at the vast information on encryption in the MSDN and got pretty confused. All I want to do is to encrypt a string into an encrypted string and later decrypt that (encrypted)...
1
by: Tommy | last post by:
I want to encrypt the values of my cookies. I found out that I could create a FormsAuthenticationTicket, and use the FormsAuthentication.Encrypt method to encrypt the cookie. However, I do not...
1
by: DazedAndConfused | last post by:
Can you encrpt a serialized object? Or am I trying to do something that just doesn't work that way? I am trying to encrypt a serialized object. I can read and write the object to a file...
8
by: toupeira23 | last post by:
Hello, I'm trying to encrypt passwords in my app. After discovering that there's no simple function to do this, I wrote a wrapper class which decodes a string using UTF8, encrypts it with...
2
by: fineman | last post by:
Hi all, I want to get a 64bit(8 bytes) Encrypt result use DES class in the VS2005. Though I encrypt data is 64bit(8 bytes), but DES return encrypt result that always is 128bit(16 bytes), I don't...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
0
by: lildiapaz | last post by:
Hi, everyone I'm developing a c# windows application that allows the user to encrypt any file type. i would like to encrypt the file using a powerful encrypting algorithm. I've tried to use the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.