I think I understand what you want, but I can only think of a workaround. And it isn't very elegant.
When you validate the user entered string, run a loop going through all the date permutations you want (every day, start of each month, whatever), encrypting each one with your key.
Then compare each string with the user entered one.
If you get a match, you know the expiry date. If there is no match at all, the user string is invalid.
I don't profess to be any form of expert on such things, but I'd hazard a guess that providing your end user with the encryption key and relying only on their ignorance of the true purpose of this file would be a major security flaw.
People can get very imaginative when they want to. If I understand the proposition correctly, you're giving them the ingredients but hoping they don't know how to bake a cake.
Welcome Mr.WHRoeder, if you are here! I would be curious what is your opinion about this topic.
Is it possible somehow getting back my_string? Or is there any other good solution?
To add comments, please log in or register