views:

120

answers:

4

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 start reading into Steganography too :)

Thanks for the help guys!

+2  A: 

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.

RedFilter
Sadly, I dont have that option, like my post said, I need to do this in a 16 character HEX string
Mark
+2  A: 

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?

aschepis
Im going to stop saying GUID, that was obviously the wrong thing to say, but the restriction is that I can only use a 16 character string (possibly 32 Im still investigating) and each character must be HEX
Mark
+2  A: 

If you change the GUID manually, you might break the uniqueness of it.

ho1
GUID was the wrong word, sorry, its a 16 character HEX string
Mark
A: 

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

Doobi