By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,490 Members | 1,791 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,490 IT Pros & Developers. It's quick & easy.

Algorithm to Generate an Expiry Date

Expert 100+
P: 446
Hi
Does anyone have any code that would generate a Software Key, which a user would then enter to generate a new Expiry Date ?

I'm sure I could conjure something up but hate re-inventing wheels !

S7
Jan 20 '12 #1
Share this Question
Share on Google+
7 Replies


Rabbit
Expert Mod 10K+
P: 12,421
I don't have any code but as far as coming up with a scheme to do so, I'm up for that discussion.

Would it be unique to a user? Because then you could use a hash of the user's name with the expiry date as a salt. Then append or prepend the expiry date using a simple reversible encryption such as Base16.
Jan 20 '12 #2

Expert 100+
P: 446
Hi Rabbit
Would it be unique to a user? Because then you could use a hash of the user's name with the expiry date as a salt. Then append or prepend the expiry date using a simple reversible encryption such as Base16.
I have no idea what you are talking about!! Hash and salt? Anyway,I'm up for it! I'm just a humble engineer. That's why I asked the question. I hoped someone with more knowledge than myself would respond.

Yes it makes sense to include the username (or Company name), so long as it can be decoded.

To start the ball rolling, currently I hard code the expiry date into the current event of the startup form. That way it's not stored in the database. Most of my users would not be able find and change it but obviously it's not very secure.

A month before the expiry date I give a warning to renew the license each time the application starts. For the month after expiry I put up a message to say it has expired and after that they get the message every form change. Only after 3 months to I stop them using it.

With this arrangement I have to supply a revised front-end which is a nuisance if no other changes are required.

What I am thinking of is something more conventional where the user opens a special form and enters the new software key. This would then decode the key and presumably put a date, or number of days into the database. My existing code would then read this and workout the current status.

I have other ideas but that's the start.
S7
Jan 20 '12 #3

Rabbit
Expert Mod 10K+
P: 12,421
A hash is basically a one way encryption. A salt is a value used to initialize the function values so that the same input doesn't result in the same output.

You can use either a reversible encryption, which means you would have to store the key or password in the program code but is slightly more secure, or you can use a one way encryption, which is slightly less secure but easier to implement.

Here are a couple of articles I wrote that discuss implementations of encryption algorithms in VBA.
Jan 21 '12 #4

100+
P: 759
Only for subscribe to this thread.
Thank you !
Jan 21 '12 #5

Expert 100+
P: 446
@Rabbit
Well that's my reading for the weekend!
Many thanks
S7
Jan 21 '12 #6

100+
P: 332
Just watching this out.
Jan 23 '12 #7

Rabbit
Expert Mod 10K+
P: 12,421
Just so we're clear, there's no way to do this that is fool proof. CD Keys get cracked all the time. What we can do, however, is provide a modicum of security that will keep out the majority of users.
Jan 23 '12 #8

Post your reply

Sign in to post your reply or Sign up for a free account.