how could I store data within a GUID
I have an application that I want to represent a users session (just small pieces of data here and there) within a GUID. Its a 16 HEX characters (so 16^16 possible values) string and I want to 'encode' some data within that GUID.
How can I achieve this? I am really after any ideas and implementations here, Ive not yet decided on the best mechanism for it yet.
I would also like encryption to be involved if possible...
Thanks a lot Mark
EDIT:
Thanks so much for the help so far everyone, I think I must have left out WAY too much information on this. Ill try to clarify.
I'm not using GUID's in the traditional sense, they are not GUID's in that they are globally unique, but they are a series of 16 characters, each is a HEX value, hence the 16^16 possible byte values.
This restriction is enforced by my environment, and our desired achievement is to encrypt data of a users session (which COULD theoretically be duplicated by chance, which, trust me, is ok), such data could be bit-flags identifying products in a group of products, etc...
I hope that makes sense, Ill 开发者_StackOverflow社区start reading into Steganography too :)
Thanks for the help guys!
The point of a GUID is that it is generated and is globally unique. once you start hacking them up to encode data in them you may violate some of the constraints that make them unique.
Why do you need to use a GUID? can you use a GUID as a lookup into a more appropriate data structure?
If you change the GUID manually, you might break the uniqueness of it.
I am guessing you intend to perform some type of steganography. A GUID is not 16 characters, see here for more info.
You would probably be better off encoding such info in images or other less obvious targets, unless that poses insurmountable technical barriers.
I think the term you're looking for is a hash or token, not so much a GUID.
Look into is using symmetrical encryption, like AES, there's a good bit of starting code here: http://www.codeproject.com/KB/security/DotNetCrypto.aspx
精彩评论