You could use encryption, perhaps. Also, if you do some Googling, you'll find that the consensus made by all programmers, is that there is no sure-fire way to protect against hackers etc. (especially when it comes to licensing/security/trials.
See my post on my licensing system.
I suggest storing it in several places, and not as a raw value (perhaps encrypted, compressed, hashed?), then check whether all stored values are equal (or even better still, add uo to a certain value, or when used in a calcualtion, equal a specified value. This is what I implemented.
Hope this helps :)