473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Algorithm to Generate an Expiry Date

446 Expert 256MB
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
7 2709
Rabbit
12,516 Expert Mod 8TB
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
sierra7
446 Expert 256MB
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
12,516 Expert Mod 8TB
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
Mihail
759 512MB
Only for subscribe to this thread.
Thank you !
Jan 21 '12 #5
sierra7
446 Expert 256MB
@Rabbit
Well that's my reading for the weekend!
Many thanks
S7
Jan 21 '12 #6
Mariostg
332 100+
Just watching this out.
Jan 23 '12 #7
Rabbit
12,516 Expert Mod 8TB
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

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

Similar topics

2
by: Vince C. | last post by:
Hi all. I'm trying to set a cookie expiry date but my script is JS (JavaScript). I've tried Response.Cookies("Test").Expires = Date(); Response.Cookies("Test").Expires =...
1
by: | last post by:
How does one read and write the cookie expiration date. At the moment my code is returning a value BUT a garbled value: '//Write cookie... Response.Cookies("Propsect").Expires = Date() + 1 ...
6
by: Ray | last post by:
Below is the code to save the cookie and set the expiry date of the cooki Response.Cookies.Value ="Hello" DateTime dt = DateTime.Now TimeSpan ts = new TimeSpan(0,0,10,0) Response.Cookies...
2
by: Dave | last post by:
Hi, Can anyone suggest a way to generate a licence key from C/C++ program? I want to create a licence file include an encrypted text and an expiry date. The private key is hard coded in the...
4
by: William Bradley | last post by:
I have two cells on a form. One of them is the "Production Date" and the other is the "Expiry Date". The "Expiry Date" is 183 days after the "Production Date." On an Excel spreadsheet, the...
2
by: William Bradley | last post by:
"Marshall Barton" <marshbarton@wowway.com> wrote in message news:9as9lvgpnp783kogctb88c8giaepb5uf6g@4ax.com... > William Bradley wrote: > >I have two cells on a form. One of them is the...
3
by: hasanainf | last post by:
Hi all, What will be the best database design for an inventory control that uses expiry date for its products. Over a period of time, a particular product will have many expiry date and that...
1
by: Rob Kell | last post by:
I have a vb.net application that emails people daily information. I want to set an expiry for the email so that those who cannot check their emails for a period are not loaded with them when they...
0
by: mplpost | last post by:
We have created a Certificate for the purpose of symmetric encryption. We did not mention the expiry date explicitly, only later we found out that, if expiry date not mentioned then the default...
1
by: tutusaint | last post by:
I have a user login authentication scrip which validates users emailid and password. I want it to also check and validate users expiry date in the database. I have user details like name,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.