how to create registration for my program?

hi all!
i have a program and wanted to create a function that user can register with a name and a key
i added 2 textboxes and 2 buttons, 1 register and 1 cancel
so what must be done if user write's the key correctly, it say's for example "the software registered successfully"
or if the user write's the registration information incorrectly, it say's "invalid registration information"
i can create the messageboxes
but i dont know how does it work and how can i write that code?
thanks in advance
Are you writing for Windows, OSX, or a Linux variant? Which IDE are you using and what framework, if any?
i'm using code::blocks for my ide, wxWidgets for my development, i want to write for all the operating systems, but first of all i need windows
the simpliest approach would be: You have an encrypted file with information regarding the registration. The name and key is required to decrypt that file.

So if valid information is found "the software registered successfully" otherwise "invalid registration information"
in windows, i want to registration information saved in registry
i know registry and this is not a problem but:
i have a problem.
for example, user buy a key with his name.
how this key can generate and how can my program know this is correct or incorrect?
and a question again:
how can i create a function that give's the registration information and place it in registry?
closed account (G309216C)
Better create, a server and a client (the application with buttons). Then create a network connection with the server using Win-sock (if using native Windows API) or other 3rd party library then when the user inputs a registration code or number, the client will send the code\number across to the server which will accept or decline the request if code\number correct it will accept if the code\number is wrong it will decline.

The connection should be encrypted to make sure that anyone reading the incoming\outgoing data should not be able to understand the protocol of your application that way it will definitely hinder users ability to tamper with the application in order to steal.

A good suggestion\idea for encryption to use would be:
[-]MD5
[-]RSA
[-]AES

least of fall but easiest would be XOR

Good Luck!
i'm sorry but md5 is hash not an encryption
i know these but i dont know how can i encrypt.
name should be encrypted by key, name and key boath must be encrypted by another string?
and what is the best library for this perpess?
and how can i create a program for server that give' the information and accept or decline it?
and a question again:
how can i create this feature that my program check's if any update is found or not?
Ideally, do not store the password/key, even as cyphertext (in an encrypted form).

Instead, store a salted hash (say SHA256) of the password/key. For example, for each user, you could store:

sha256 hash of the user name.
randomly generated salt for this user.
sha256 salted hash of the password/key.

To validate a user name and password/key:

a. compute the sha256 hash of user name
b. look up hash and get the salt for this user
c. append the salt to the password/key
d. compute its sha256 hash
e. verify against the stored hash.

> and what is the best library for this perpess?

The best library for this would be a cross-platform cryptographic hash library, that is easy to installl and use.
For instance hashlib++ http://hashlib2plus.sourceforge.net/index.html
Last edited on
can i use crypto++?
it has hash and encryption functions
and how can my program access the server in order to check if the given information is correct or not?
> can i use crypto++?

You certainly can.

> how can my program access the server in order to check if the given information is correct or not?

Take it one step at a time. First get the program working on the local machine with local credential verification.

Once you have done that, there are a whole lot of architectural issues to be considered.

Will the server be behind a firewall (as it ought to be)?
Will you use a web service to access the server (SOAP or REST)?
How will you provide fault tolerance? (Server crashes? Network down? DoS attacks?)
etc.
my server isn't behind a firewall and i want to access it by using my program.
so what should be done in the server and what should be done in my program?
Topic archived. No new replies allowed.