I use a system like this:
• create a string from windows licence key + trial period end date
• generate a hash (Sha/md5) from the string
• convert the trial end date to an int (e.g. Number of days)
• the key becomes trial end date + some part of the hash
• convert the key to only uppercase characters to make it easier to enter
ABCD-DEFG-HIJK...
the validation works like
• convert key to bytes again
• extract trial end date
• create string from windows licence key + trial end date
• hash
• compare hash with rest of key
this makes it difficult enough for my audience.