Re: encoding/decoding question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Thu, 21 Jun 2007 20:28:50 -0700, Bartholomew Simpson <123evergreen@xxxxxxxxxxx> wrote:

[...]
Can anyone help me with how to encrypt these numbers into one new number: numEncoded
(and equally importantly), how to decode each of the components, when presented with the encoded number ?

Well, .NET has the Cryptography namespace that you can use to encrypt stuff. So I would just put your data into some kind of single data structure (serialize it into a MemoryStream, for example) and then encrypt it. Decrypt it later, and deserialize it, and there you go.

I realize that's a more general reply than the specific "into one new number", but since you don't specify just how large the "new number" is expected to be, and the example input data isn't going to fit in 64 bits (the longest integral numeric type I'm aware of), I figure you're not really wanting to stick everything literally into a single number.

Pete
.



Relevant Pages