# Software Registration Generator 101

Topics

:

Overview
Constants
Type Definitions
Encryption Rules
Functions

Overview

The software registration generator is used to generate proprietary software registration numbers using A-C-E level one encryption and a magic number sequence. This implementation uses a standard encryption method offset by a magic number polynomial allowing you to create and maintain proprietary registration codes.

Constants

Constants used to configure the software registration generator. If any of these constants are modified the software registration numbers will be changed. This will effect all applications using the srnGenerator class to generate registration codes.

    const double srnVersionNumber = 4000.101;    // Current version
    const char srnSegmentSeparator = '-';        // Separator character
    const unsigned srnMaxStringLength = 255;     // Max chars per string
    const unsigned srnTableSize = 256;           // Table size for magic numbers
    const unsigned srnMaxNameChars = 8;          // Max chars per program name
    const srnIntType srnPolynomial = 0xbca44105; // Magic number polynomial

* Change the magic number polynomial constant to generate proprietary registration codes.

Type Definitions

srnIntType -

Integer type use for magic numbers.

A-C-E Level One Alphanumeric Encryption Rules

A-C-E level one encryption is used to generate an alphanumeric code sequence based on a character string. There are a total of 11 encryption rules with a special rule for non-alphanumeric characters.

1. All non-printable chars will be treated as letter 'g' or disallowed depending on the application.
2. All letters of the string will be evaluated according to case during the encryption process.
3. All even numbers will be converted to odd numbers: 0=9, 2=7, 4=5, 6=3, 8=1.
4. Odd numbers (except 5) will be converted to letters: 1='o', 3='I', 7='q', 9=W'.
5. Every other letter from the beginning of the alphabet will be converted to even numbered letters starting from 'Y' to 'O': B=Y, b=k , D=W, d=i, F=U, f=g , H=S, h=e, J=Q, j=c, L=O, l=a, and from 'A' to 'K': Z=A, z=o , X=C, x=q , V=E, v=s , T=G, t=u ,R=I, r=w, P=K, p=y.
6. The letter 'N' will be converted to the number 7.
7. The number 5 will be converted to letter 'G'.
8. All omitted letters will retain the case of the letters they have been substituted with.
9. The letters A, C, E, G, I, K, M, O, Q, S, U, W, and Y will be retain their original case in reverse order: A=Y, C=W, E=U, G=S, I=Q, K=O, M=7, O=K, Q=I, S=G, U=E, W=C, and Y=A.
10. The letters a, c, e, g, i, k, m, o, q, s, u, w, and y will be converted to odd numbers: a=9, c=7, e=3, g=1, i=5, k=5, m=5, o=5, q=5, s=9, u=7, w=3, and y=1.
11. All final values will be offset by a random value according to the number of times it occurs in the string.
12. Special rules for non-alphanumerics: All non-alphanumeric characters will be converted to even numbers or ever other letter of the alphabet depending on its keyboard location: !=Z, @=x, #=U, $=t, %=R, ^=p, &=B, *=d, (=F, )=h, -=J, _=l, ==N, +=0, [=8, {=4, ]=2, }=z, \=X, |=u, ;=T, :=r, '=P, "=b, <=D, ,=f, >=H, .=j, `=L, ~=n, /=0, ?=8.

Functions

srnGenerator::srnGenerator()
srnGenerator::~srnGenerator()
srnGenerator::GenMagicNumber()
srnGenerator::GenRegString()
srnGenerator::GetMagicNumber()
srnGenerator::GetRegCode()
srnGenerator::GetRegString()
srnGenerator::Validate()

srnGenerator::srnGenerator()

- Default class constructor.

srnGenerator::srnGenerator(const char *pname, const char *user_name)

- Class constructor used to construct an srnGenerator object and generate a registration code based on an arbitrary program and user name string.

srnGenerator::srnGenerator(const srnGenerator &ob)

- Class copy constructor.

srnGenerator srnGenerator::operator=(const srnGenerator &ob)

- Assignment operator.

srnGenerator::~srnGenerator()

- Class destructor.

srnIntType srnGenerator::GenMagicNumber(const char *pname, const char *user_name)

- Public member function used to generate a magic number based on the program's name. This function is called by the srnGenerator::GenRegString() functions but can be used by the application to validate magic numbers.

void srnGenerator::GenRegString(const char *pname, const char *user_name)

- Public member function used to generate a registration code based on an arbitrary program and user name string.

srnIntType srnGenerator::GetMagicNumber()

- Public member function that returns the magic number sequence currently in use.

char *srnGenerator::GetRegCode()

- Public member function that returns a registration code containing the registration string, segment separator, and magic number sequence.

char *srnGenerator::GetRegString()

- Public member function that returns the registration string.

int srnGenerator::Validate(const char *regCode, const char *pname,const char *user_name)

- Public member function used to validate a software registration string and magic number. Returns true if the software registration string matches the program name, user name, and the magic number sequence.

End Of Document