Click here to Skip to main content
15,881,816 members
Articles / Desktop Programming / MFC

Build your own cryptographically safe server/client protocol

Rate me:
Please Sign up or sign in to vote.
4.95/5 (125 votes)
21 Jun 2006CPOL37 min read 393.9K   22.3K   380  
This article presents all you need to implement your own secure protocol using variable keysize RSA encryption/decryption, digital signing, multi precision library, Diffie-Hellman key exchange, Rijndael, and more. Everything is converged into a secure IOCP client/server chat server.
ADAPTIVE PUBLIC LICENSE Version 1.0 

THE LICENSED WORK IS PROVIDED UNDER THE TERMS OF THIS ADAPTIVE PUBLIC
LICENSE ("LICENSE"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE
LICENSED WORK CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS LICENSE AND
ITS TERMS, WHETHER OR NOT SUCH RECIPIENT READS THE TERMS OF THIS
LICENSE. "LICENSED WORK" AND "RECIPIENT" ARE DEFINED BELOW.

IMPORTANT NOTE: This License is "adaptive", and the generic version or
another version of an Adaptive Public License should not be relied upon
to determine your rights and obligations under this License. You must
read the specific Adaptive Public License that you receive with the
Licensed Work, as certain terms are defined at the outset by the
Initial Contributor.

See Section 2.2 below, Exhibit A attached, and any Suppfile.txt
accompanying this License to determine the specific adaptive features
applicable to this License. For example, without limiting the
foregoing, (a) for selected choice of law and jurisdiction see Part 3
of Exhibit A; (b) for the selected definition of Third Party see Part 4
of Exhibit A; and (c) for selected patent licensing terms (if any) see
Section 2.2 below and Part 6 of Exhibit A.

1. DEFINITIONS.

    1.1. "CONTRIBUTION" means:

        (a) In the case of the Initial Contributor, the Initial Work
        distributed under this License by the Initial Contributor; and

        (b) In the case of each Subsequent Contributor, the Subsequent
        Work originating from and distributed by such Subsequent
        Contributor.

    1.2. "DESIGNATED WEB SITE" means the web site having the URL
    identified in Part 1 of Exhibit A, which URL may be changed by the
    Initial Contributor by posting on the current Designated Web Site
    the new URL for at least sixty (60) days.

    1.3. "DISTRIBUTOR" means any Person that distributes the Licensed
    Work or any portion thereof to at least one Third Party.

    1.4. "ELECTRONIC DISTRIBUTION MECHANISM" means any mechanism
    generally accepted in the software development community for the
    electronic transfer of data.

    1.5. "EXECUTABLE" means the Licensed Work in any form other than
    Source Code.

    1.6. "GOVERNING JURISDICTION" means the state, province or other
    legal jurisdiction identified in Part 3 of Exhibit A.

    1.7. "INDEPENDENT MODULE" means a separate module of software
    and/or data that is not a derivative work of or copied from the
    Licensed Work or any portion thereof. In addition, a module does
    not qualify as an Independent Module but instead forms part of the
    Licensed Work if the module: (a) is embedded in the Licensed Work;
    (b) is included by reference in the Licensed Work other than by a
    function call or a class reference; or (c) must be included or
    contained, in whole or in part, within a file directory or
    subdirectory actually containing files making up the Licensed Work.

    1.8. "INITIAL CONTRIBUTOR" means the Person or entity identified as
    the Initial Contributor in the notice required by Part 1 of Exhibit
    A.

    1.9. "INITIAL WORK" means the initial Source Code, object code (if
    any) and documentation for the computer program identified in Part
    2 of Exhibit A, as such Source Code, object code and documentation
    is distributed under this License by the Initial Contributor.

    1.10. "LARGER WORK" means a work that combines the Licensed Work or
    portions thereof with code not governed by this License.

    1.11. "LICENSED WORK" means the Initial Work and/or any Subsequent
    Work, in each case including portions thereof.

    1.12. "LICENSE NOTICE" has the meaning assigned in Part 5 of
    Exhibit A.

    1.13. "MODIFICATION" or "MODIFICATIONS" means any change to and/or
    addition to the Licensed Work.

    1.14. "PERSON" means an individual or other legal entity, including
    a corporation, partnership or other body.

    1.15. "RECIPIENT" means any Person who receives or obtains the
    Licensed Work under this License (by way of example, without
    limiting the foregoing, any Subsequent Contributor or Distributor).

    1.16. "SOURCE CODE" means the source code for a computer program,
    including the source code for all modules and components of the
    computer program, plus any associated interface definition files,
    and scripts used to control compilation and installation of an
    executable.

    1.17. "SUBSEQUENT CONTRIBUTOR" means any Person that makes or
    contributes to the making of any Subsequent Work and that
    distributes that Subsequent Work to at least one Third Party.

    1.18. "SUBSEQUENT WORK" means a work that has resulted or arises
    from changes to and/or additions to:

        (a) the Initial Work;

        (b) any other Subsequent Work; or

        (c) to any combination of the Initial Work and any such other
        Subsequent Work;

        where such changes and/or additions originate from a Subsequent
        Contributor. A Subsequent Work will "originate" from a
        Subsequent Contributor if the Subsequent Work was a result of
        efforts by such Subsequent Contributor (or anyone acting on
        such Subsequent Contributor's behalf, such as, a contractor or
        other entity that is engaged by or under the direction of the
        Subsequent Contributor). For greater certainty, a Subsequent
        Work expressly excludes and shall not capture within its
        meaning any Independent Module.

    1.19. "SUPPLEMENT FILE" means a file distributed with the Licensed
    Work having a file name "suppfile.txt".

    1.20. "THIRD PARTY" has the meaning assigned in Part 4 of Exhibit
    A.

2. LICENSE.

    2.1. COPYRIGHT LICENSE FROM INITIAL AND SUBSEQUENT CONTRIBUTORS.

        (a) Subject to the terms of this License, the Initial
        Contributor hereby grants each Recipient a world-wide,
        royalty-free, non-exclusive copyright license to:

            (i) reproduce, prepare derivative works of, publicly
            display, publicly perform, distribute and sublicense the
            Initial Work; and

            (ii) reproduce, publicly display, publicly perform,
            distribute, and sublicense any derivative works (if any)
            prepared by Recipient;

        in Source Code and Executable form, either with other
        Modifications, on an unmodified basis, or as part of a Larger
        Work.

        (b) Subject to the terms of this License, each Subsequent
        Contributor hereby grants each Recipient a world-wide,
        royalty-free, non-exclusive copyright license to:

            (i) reproduce, prepare derivative works of, publicly
            display, publicly perform, distribute and sublicense the
            Subsequent Work of such Subsequent Contributor; and

            (ii) reproduce, publicly display, publicly perform,
            distribute, and sublicense any derivative works (if any)
            prepared by Recipient;

        in Source Code and Executable form, either with other
        Modifications, on an unmodified basis, or as part of a Larger
        Work.

    2.2. PATENT LICENSE FROM INITIAL AND SUBSEQUENT CONTRIBUTORS.

        (a) This License does not include or grant any patent license
        whatsoever from the Initial Contributor, Subsequent
        Contributor, or any Distributor unless, at the time the Initial
        Work is first distributed or made available under this License
        (as the case may be), the Initial Contributor has selected
        pursuant to Part 6 of Exhibit A the patent terms in paragraphs
        A, B, C, D and E from Part 6 of Exhibit A. If this is not done
        then the Initial Work and any other Subsequent Work is made
        available under the License without any patent license (the
        "PATENTS-EXCLUDED LICENSE").

        (b) However, the Initial Contributor may subsequently
        distribute or make available (as the case may be) future copies
        of: (1) the Initial Work; or (2) any Licensed Work distributed
        by the Initial Contributor which includes the Initial Work (or
        any portion thereof) and/or any Modification made by the
        Initial Contributor; available under a License which includes a
        patent license (the "PATENTS-INCLUDED LICENSE") by selecting
        pursuant to Part 6 of Exhibit A the patent terms in paragraphs
        A, B, C, D and E from Part 6 of Exhibit A, when the Initial
        Contributor distributes or makes available (as the case may be)
        such future copies under this License.

        (c) If any Recipient receives or obtains one or more copies of
        the Initial Work or any other portion of the Licensed Work
        under the Patents-Included License, then all licensing of such
        copies under this License shall include the terms in paragraphs
        A, B, C, D and E from Part 6 of Exhibit A and that Recipient
        shall not be able to rely upon the Patents-Excluded License for
        any such copies. However, all Recipients that receive one or
        more copies of the Initial Work or any other portion of the
        Licensed Work under a copy of the License which includes the
        Patents-Excluded License shall have no patent license with
        respect to such copies received under the Patents-Excluded
        License and availability and distribution of such copies,
        including Modifications made by such Recipient to such copies,
        shall be under a copy of the License without any patent
        license.

        (d) Where a Recipient uses in combination or combines any copy
        of the Licensed Work (or portion thereof) licensed under a copy
        of the License having a Patents-Excluded License with any copy
        of the Licensed Work (or portion thereof) licensed under a copy
        of the License having a Patents-Included License, the
        combination (and any portion thereof) shall, from the first
        time such Recipient uses, makes available or distributes the
        combination (as the case may be), be subject to only the terms
        of the License having the Patents-Included License which shall
        include the terms in paragraphs A, B, C, D and E from Part 6 of
        Exhibit A.

    2.3. ACKNOWLEDGEMENT AND DISCLAIMER.

    Recipient understands and agrees that although Initial Contributor
    and each Subsequent Contributor grants the licenses to its
    Contributions set forth herein, no representation, warranty,
    guarantee or assurance is provided by any Initial Contributor,
    Subsequent Contributor, or Distributor that the Licensed Work does
    not infringe the patent or other intellectual property rights of
    any other entity. Initial Contributor, Subsequent Contributor, and
    each Distributor disclaims any liability to Recipient for claims
    brought by any other entity based on infringement of intellectual
    property rights or otherwise, in relation to the Licensed Works. As
    a condition to exercising the rights and licenses granted
    hereunder, each Recipient hereby assumes sole responsibility to
    secure any other intellectual property rights needed, if any. For
    example, without limiting the foregoing disclaimers, if a third
    party patent license is required to allow Recipient to distribute
    the Licensed Work, it is Recipient's responsibility to acquire that
    license before distributing the Licensed Work.

    2.4. RESERVATION.

    Nothing in this License shall be deemed to grant any rights to
    trademarks, copyrights, patents, trade secrets or any other
    intellectual property of Initial Contributor, Subsequent
    Contributor, or Distributor except as expressly stated herein.

3. DISTRIBUTION OBLIGATIONS.

    3.1. DISTRIBUTION GENERALLY.

        (a) A Subsequent Contributor shall make that Subsequent
        Contributor's Subsequent Work(s) available to the public via an
        Electronic Distribution Mechanism for a period of at least
        twelve (12) months. The aforesaid twelve (12) month period
        shall begin within a reasonable time after the creation of the
        Subsequent Work and no later than sixty (60) days after first
        distribution of that Subsequent Contributor's Subsequent Work.

        (b) All Distributors must distribute the Licensed Work in
        accordance with the terms of the License, and must include a
        copy of this License (including without limitation Exhibit A
        and the accompanying Supplement File) with each copy of the
        Licensed Work distributed. In particular, this License must be
        prominently distributed with the Licensed Work in a file called
        "license.txt." In addition, the License Notice in Part 5 of
        Exhibit A must be included at the beginning of all Source Code
        files, and viewable to a user in any executable such that the
        License Notice is reasonably brought to the attention of any
        party using the Licensed Work.

    3.2. EXECUTABLE DISTRIBUTIONS OF THE LICENSED WORK.

    A Distributor may choose to distribute the Licensed Work, or any
    portion thereof, in Executable form (an "EXECUTABLE DISTRIBUTION")
    to any third party, under the terms of Section 2 of this License,
    provided the Executable Distribution is made available under and
    accompanied by a copy of this License, AND provided at least ONE of
    the following conditions is fulfilled:

        (a) The Executable Distribution must be accompanied by the
        Source Code for the Licensed Work making up the Executable
        Distribution, and the Source Code must be distributed on the
        same media as the Executable Distribution or using an
        Electronic Distribution Mechanism; or

        (b) The Executable Distribution must be accompanied with a
        written offer, valid for at least thirty six (36) months, to
        give any third party under the terms of this License, for a
        charge no more than the cost of physically performing source
        distribution, a complete machine-readable copy of the Source
        Code for the Licensed Work making up the Executable
        Distribution, to be available and distributed using an
        Electronic Distribution Mechanism, and such Executable
        Distribution must remain available in Source Code form to any
        third party via the Electronic Distribution Mechanism (or any
        replacement Electronic Distribution Mechanism the particular
        Distributor may reasonably need to turn to as a substitute) for
        said at least thirty six (36) months.

    For greater certainty, the above-noted requirements apply to any
    Licensed Work or portion thereof distributed to any third party in
    Executable form, whether such distribution is made alone, in
    combination with a Larger Work or Independent Modules, or in some
    other combination.

    3.3. SOURCE CODE DISTRIBUTIONS.

    When a Distributor makes the Licensed Work, or any portion thereof,
    available to any Person in Source Code form, it must be made
    available under this License and a copy of this License must be
    included with each copy of the Source Code, situated so that the
    copy of the License is conspicuously brought to the attention of
    that Person. For greater clarification, this Section 3.3 applies to
    all distribution of the Licensed Work in any Source Code form. A
    Distributor may charge a fee for the physical act of transferring a
    copy, which charge shall be no more than the cost of physically
    performing source distribution.

    3.4. REQUIRED NOTICES IN SOURCE CODE.

    Each Subsequent Contributor must ensure that the notice set out in
    Part 5 of Exhibit A is included in each file of the Source Code for
    each Subsequent Work originating from that particular Subsequent
    Contributor, if such notice is not already included in each such
    file. If it is not possible to put such notice in a particular
    Source Code file due to its structure, then the Subsequent
    Contributor must include such notice in a location (such as a
    relevant directory in which the file is stored) where a user would
    be likely to look for such a notice.

    3.5. NO DISTRIBUTION REQUIREMENTS FOR INTERNALLY USED
    MODIFICATIONS.

    Notwithstanding Sections 3.2, 3.3 and 3.4, Recipient may,
    internally within its own corporation or organization use the
    Licensed Work, including the Initial Work and Subsequent Works, and
    make Modifications for internal use within Recipient's own
    corporation or organization (collectively, "INTERNAL USE
    MODIFICATIONS"). The Recipient shall have no obligation to
    distribute, in either Source Code or Executable form, any such
    Internal Use Modifications made by Recipient in the course of such
    internal use, except where required below in this Section 3.5. All
    Internal Use Modifications distributed to any Person, whether or
    not a Third Party, shall be distributed pursuant to and be
    accompanied by the terms of this License. If the Recipient chooses
    to distribute any such Internal Use Modifications to any Third
    Party, then the Recipient shall be deemed a Subsequent Contributor,
    and any such Internal Use Modifications distributed to any Third
    Party shall be deemed a Subsequent Work originating from that
    Subsequent Contributor, and shall from the first such instance
    become part of the Licensed Work that must thereafter be
    distributed and made available to third parties in accordance with
    the terms of Sections 3.1 to 3.4 inclusive.

    3.6. INDEPENDENT MODULES.

    This License shall not apply to Independent Modules of any Initial
    Contributor, Subsequent Contributor, Distributor or any Recipient,
    and such Independent Modules may be licensed or made available
    under one or more separate license agreements.

    3.7. LARGER WORKS.

    Any Distributor or Recipient may create or contribute to a Larger
    Work by combining any of the Licensed Work with other code not
    governed by the terms of this License, and may distribute the
    Larger Work as one or more products. However, in any such case,
    Distributor or Recipient (as the case may be) must make sure that
    the requirements of this License are fulfilled for the Licensed
    Work portion of the Larger Work.

    3.8. DESCRIPTION OF DISTRIBUTED MODIFICATIONS.

        (a) Each Subsequent Contributor (including the Initial
        Contributor where the Initial Contributor also qualifies as a
        Subsequent Contributor) must cause each Subsequent Work created
        or contributed to by that Subsequent Contributor to contain a
        file documenting the changes, in accordance with the
        requirements of Part 1 of the Supplement File, that such
        Subsequent Contributor made in the creation or contribution to
        that Subsequent Work. If no Supplement File exists or no
        requirements are set out in Part 1 of the Supplement File, then
        there are no requirements for Subsequent Contributors to
        document changes that they make resulting in Subsequent Works.

        (b) The Initial Contributor may at any time introduce
        requirements or add to or change earlier requirements (in each
        case, the "EARLIER DESCRIPTION REQUIREMENTS") for documenting
        changes resulting in Subsequent Works by revising Part 1 of
        each copy of the Supplement File distributed by the Initial
        Contributor with future copies of the Licensed Work so that
        Part 1 then contains new requirements (the "NEW DESCRIPTION
        REQUIREMENTS") for documenting such changes.

        (c) Any Recipient receiving at any time any copy of an Initial
        Work or any Subsequent Work under a copy of this License (in
        each case, an "Earlier LICENSED COPY") having the Earlier
        Description Requirements may choose, with respect to each such
        Earlier Licensed Copy, to comply with the Earlier Description
        Requirements or the New Description Requirements. Where a
        Recipient chooses to comply with the New Description
        Requirements, that Recipient will, when thereafter distributing
        any copies of any such Earlier Licensed Copy, include a
        Supplement File having a section entitled Part 1 that contains
        a copy of the New Description Requirements.

        (d) For greater certainty, the intent of Part 1 of the
        Supplement File is to provide a mechanism (if any) by which
        Subsequent Contributors must document changes that they make to
        the Licensed Work resulting in Subsequent Works. Part 1 of any
        Supplement File shall not be used to increase or reduce the
        scope of the license granted in Article 2 of this License or in
        any other way increase or decrease the rights and obligations
        of any Recipient, and shall at no time serve as the basis for
        terminating the License. Further, a Recipient can be required
        to correct and change its documentation procedures to comply
        with Part 1 of the Supplement File, but cannot be penalised
        with damages. Part 1 of any Supplement File is only binding on
        each Recipient of any Licensed Work to the extent Part 1 sets
        out the requirements for documenting changes to the Initial
        Work or any Subsequent Work.

        (e) An example of a set of requirements for documenting changes
        and contributions made by Subsequent Contributor is set out in
        Part 7 of Exhibit A of this License. Part 7 is a sample only
        and is not binding on Recipients, unless (subject to the
        earlier paragraphs of this Section 3.8) those are the
        requirements that the Initial Contributor includes in Part 1 of
        the Supplement File with the copies of the Initial Work
        distributed under this License.

    3.9. USE OF DISTRIBUTOR NAME.

    The name of a Distributor may not be used by any other Distributor
    to endorse or promote the Licensed Work or products derived from
    the Licensed Work, without prior written permission.

    3.10. LIMITED RECOGNITION OF INITIAL CONTRIBUTOR.

        (a) As a modest attribution to the Initial Contributor, in the
        hope that its promotional value may help justify the time,
        money and effort invested in writing the Initial Work, the
        Initial Contributor may include in Part 2 of the Supplement
        File a requirement that each time an executable program
        resulting from the Initial Work or any Subsequent Work, or a
        program dependent thereon, is launched or run, a prominent
        display of the Initial Contributor's attribution information
        must occur (the "ATTRIBUTION INFORMATION"). The Attribution
        Information must be included at the beginning of each Source
        Code file. For greater certainty, the Initial Contributor may
        specify in the Supplement File that the above attribution
        requirement only applies to an executable program resulting
        from the Initial Work or any Subsequent Work, but not a program
        dependent thereon. The intent is to provide for reasonably
        modest attribution, therefore the Initial Contributor may not
        require Recipients to display, at any time, more than the
        following Attribution Information: (a) a copyright notice
        including the name of the Initial Contributor; (b) a word or
        one phrase (not exceeding 10 words); (c) one digital image or
        graphic provided with the Initial Work; and (d) a URL
        (collectively, the "ATTRIBUTION LIMITS").

        (b) If no Supplement File exists, or no Attribution Information
        is set out in Part 2 of the Supplement File, then there are no
        requirements for Recipients to display any Attribution
        Information of the Initial Contributor.

        (c) Each Recipient acknowledges that all trademarks, service
        marks and/or trade names contained within Part 2 of the
        Supplement File distributed with the Licensed Work are the
        exclusive property of the Initial Contributor and may only be
        used with the permission of the Initial Contributor, or under
        circumstances otherwise permitted by law, or as expressly set
        out in this License.

    3.11. For greater certainty, any description or attribution
    provisions contained within a Supplement File may only be used to
    specify the nature of the description or attribution requirements,
    as the case may be. Any provision in a Supplement File that
    otherwise purports to modify, vary, nullify or amend any right,
    obligation or representation contained herein shall be deemed void
    to that extent, and shall be of no force or effect.

4. COMMERCIAL USE AND INDEMNITY.

    4.1. COMMERCIAL SERVICES.

    A Recipient ("COMMERCIAL RECIPIENT") may choose to offer, and to
    charge a fee for, warranty, support, indemnity or liability
    obligations (collectively, "SERVICES") to one or more other
    Recipients or Distributors. However, such Commercial Recipient may
    do so only on that Commercial Recipient's own behalf, and not on
    behalf of any other Distributor or Recipient, and Commercial
    Recipient must make it clear than any such warranty, support,
    indemnity or liability obligation(s) is/are offered by Commercial
    Recipient alone. At no time may Commercial Recipient use any
    Services to deny any party the Licensed Work in Source Code or
    Executable form when so required under any of the other terms of
    this License. For greater certainty, this Section 4.1 does not
    diminish any of the other terms of this License, including without
    limitation the obligation of the Commercial Recipient as a
    Distributor, when distributing any of the Licensed Work in Source
    Code or Executable form, to make such distribution royalty-free
    (subject to the right to charge a fee of no more than the cost of
    physically performing Source Code or Executable distribution (as
    the case may be)).

    4.2. INDEMNITY.

    Commercial distributors of software may accept certain
    responsibilities with respect to end users, business partners and
    the like. While this License is intended to facilitate the
    commercial use of the Licensed Work, the Distributor who includes
    any of the Licensed Work in a commercial product offering should do
    so in a manner which does not create potential liability for other
    Distributors. Therefore, if a Distributor includes the Licensed
    Work in a commercial product offering or offers any Services, such
    Distributor ("COMMERCIAL DISTRIBUTOR") hereby agrees to defend and
    indemnify every other Distributor or Subsequent Contributor (in
    each case an "INDEMNIFIED PARTY") against any losses, damages and
    costs (collectively "LOSSES") arising from claims, lawsuits and
    other legal actions brought by a third party against the
    Indemnified Party to the extent caused by the acts or omissions of
    such Commercial Distributor in connection with its distribution of
    any of the Licensed Work in a commercial product offering or in
    connection with any Services. The obligations in this section do
    not apply to any claims or Losses relating to any actual or alleged
    intellectual property infringement. In order to qualify, an
    Indemnified Party must: (a) promptly notify the Commercial
    Distributor in writing of such claim; and (b) allow the Commercial
    Distributor to control, and co-operate with the Commercial
    Distributor in, the defense and any related settlement
    negotiations. The Indemnified Party may participate in any such
    claim at its own expense.

5. VERSIONS OF THE LICENSE.

    5.1. NEW VERSIONS.

    The Initial Contributor may publish revised and/or new versions of
    the License from time to time. Each version will be given a
    distinguishing version number.

    5.2. EFFECT OF NEW VERSIONS.

    Once the Licensed Work or any portion thereof has been published by
    Initial Contributor under a particular version of the License,
    Recipient may choose to continue to use it under the terms of that
    version. However, if a Recipient chooses to use the Licensed Work
    under the terms of any subsequent version of the License published
    by the Initial Contributor, then from the date of making this
    choice, the Recipient must comply with the terms of that subsequent
    version with respect to all further reproduction, preparation of
    derivative works, public display of, public performance of,
    distribution and sublicensing by the Recipient in connection with
    the Licensed Work. No one other than the Initial Contributor has
    the right to modify the terms applicable to the Licensed Work

6. DISCLAIMER OF WARRANTY.

    6.1. GENERAL DISCLAIMER.

    EXCEPT AS EXPRESSLY SET FORTH IN THIS LICENSE, THE LICENSED WORK IS
    PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT ANY
    REPRESENTATION, WARRANTY, GUARANTEE, ASSURANCE OR CONDITION OF ANY
    KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
    WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
    RISK AS TO THE QUALITY AND PERFORMANCE OF THE LICENSED WORK IS WITH
    RECIPIENT. SHOULD ANY LICENSED WORK PROVE DEFECTIVE IN ANY RESPECT,
    RECIPIENT (NOT THE INITIAL CONTRIBUTOR OR ANY SUBSEQUENT
    CONTRIBUTOR) ASSUMES THE COST OF ANY NECESSARY SERVICING, REPAIR OR
    CORRECTION. THIS CLAUSE CONSTITUTES AN ESSENTIAL PART OF THIS
    LICENSE. NO USE OF ANY LICENSED WORK IS AUTHORIZED HEREUNDER EXCEPT
    UNDER THIS LICENSE INCLUDING WITHOUT LIMITATION THIS DISCLAIMER.

    6.2. RESPONSIBILITY OF RECIPIENTS.

    Each Recipient is solely responsible for determining the
    appropriateness of using and distributing the Licensed Work and
    assumes all risks associated with its exercise of rights under this
    License, including but not limited to the risks and costs of
    program errors, compliance with applicable laws, damage to or loss
    of data, programs or equipment, and unavailability or interruption
    of operations.

7. TERMINATION.

    7.1. This License shall continue until terminated in accordance
    with the express terms herein.

    7.2. Recipient may choose to terminate this License automatically
    at any time.

    7.3. This License, including without limitation the rights granted
    hereunder to a particular Recipient, will terminate automatically
    if such Recipient is in material breach of any of the terms of this
    License and fails to cure such breach within sixty (60) days of
    becoming aware of the breach. Without limiting the foregoing, any
    material breach by such Recipient of any term of any other License
    under which such Recipient is granted any rights to the Licensed
    Work shall constitute a material breach of this License.

    7.4. Upon termination of this License by or with respect to a
    particular Recipient for any reason, all rights granted hereunder
    and under any other License to that Recipient shall terminate.
    However, all sublicenses to the Licensed Work which were previously
    properly granted by such Recipient under a copy of this License (in
    each case, an "Other License" and in plural, "Other Licenses")
    shall survive any such termination of this License, including
    without limitation the rights and obligations under such Other
    Licenses as set out in their respective Sections 2, 3, 4, 5, 6, 7
    and 8, mutatis mutandis, for so long as the respective sublicensees
    (i.e. other Recipients) remain in compliance with the terms of the
    copy of this License under which such sublicensees received rights
    to the Licensed Work. Any termination of such Other Licenses shall
    be pursuant to their respective Section 7, mutatis mutandis.
    Provisions which, by their nature, must remain in effect beyond the
    termination of this License shall survive.

    7.5. Upon any termination of this License by or with respect to a
    particular Recipient, Sections 4.1, 4.2, 6.1, 6.2, 7.4, 7.5, 8.1,
    and 8.2, together with all provisions of this License necessary for
    the interpretation and enforcement of same, shall expressly survive
    such termination.

8. LIMITATION OF LIABILITY.

    8.1. IN NO EVENT SHALL ANY OF INITIAL CONTRIBUTOR, ITS
    SUBSIDIARIES, OR AFFILIATES, OR ANY OF ITS OR THEIR RESPECTIVE
    OFFICERS, DIRECTORS, EMPLOYEES, AND/OR AGENTS (AS THE CASE MAY BE),
    HAVE ANY LIABILITY FOR ANY DIRECT DAMAGES, INDIRECT DAMAGES,
    PUNITIVE DAMAGES, INCIDENTAL DAMAGES, SPECIAL DAMAGES, EXEMPLARY
    DAMAGES, CONSEQUENTIAL DAMAGES OR ANY OTHER DAMAGES WHATSOEVER
    (INCLUDING WITHOUT LIMITATION LOSS OF USE, DATA OR PROFITS, OR ANY
    OTHER LOSS ARISING OUT OF OR IN ANY WAY RELATED TO THE USE,
    INABILITY TO USE, UNAUTHORIZED USE, PERFORMANCE, OR NON-PERFORMANCE
    OF THE LICENSED WORK OR ANY PART THEREOF OR THE PROVISION OF OR
    FAILURE TO PROVIDE SUPPORT SERVICES, OR THAT RESULT FROM ERRORS,
    DEFECTS, OMISSIONS, DELAYS IN OPERATION OR TRANSMISSION, OR ANY
    OTHER FAILURE OF PERFORMANCE), HOWEVER CAUSED AND ON ANY THEORY OF
    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    (INCLUDING NEGLIGENCE OR OTHERWISE) IN RELATION TO OR ARISING IN
    ANY WAY OUT OF THIS LICENSE OR THE USE OR DISTRIBUTION OF THE
    LICENSED WORK OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN
    IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
    LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
    RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
    PROHIBITS SUCH LIMITATION. THIS CLAUSE CONSTITUTES AN ESSENTIAL
    PART OF THIS LICENSE. NO USE OF ANY LICENSED WORK IS AUTHORIZED
    HEREUNDER EXCEPT UNDER THIS LICENSE INCLUDING WITHOUT LIMITATION
    THE LIMITATIONS SET FORTH IN THIS SECTION 8.1.

    8.2. EXCEPT AS EXPRESSLY SET FORTH IN THIS LICENSE, EACH RECIPIENT
    SHALL NOT HAVE ANY LIABILITY FOR ANY EXEMPLARY, OR CONSEQUENTIAL
    DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED
    AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
    ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE LICENSED WORK OR THE
    EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
    POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT
    APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH
    PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH
    LIMITATION.

9. GOVERNING LAW AND LEGAL ACTION.

    9.1. This License shall be governed by and construed in accordance
    with the laws of the Governing Jurisdiction assigned in Part 3 of
    Exhibit A, without regard to its conflict of law provisions. No
    party may bring a legal action under this License more than one
    year after the cause of the action arose. Each party waives its
    rights (if any) to a jury trial in any litigation arising under
    this License. Note that if the Governing Jurisdiction is not
    assigned in Part 3 of Exhibit A, then the Governing Jurisdiction
    shall be the State of New York.

    9.2. The courts of the Governing Jurisdiction shall have
    jurisdiction, but not exclusive jurisdiction, to entertain and
    determine all disputes and claims, whether for specific
    performance, injunction, damages or otherwise, both at law and in
    equity, arising out of or in any way relating to this License,
    including without limitation, the legality, validity, existence and
    enforceability of this License. Each party to this License hereby
    irrevocably attorns to and accepts the jurisdiction of the courts
    of the Governing Jurisdiction for such purposes.

    9.3. Except as expressly set forth elsewhere herein, in the event
    of any action or proceeding brought by any party against another
    under this License the prevailing party shall be entitled to
    recover all costs and expenses including the fees of its attorneys
    in such action or proceeding in such amount as the court may
    adjudge reasonable.

10. MISCELLANEOUS.

    10.1. The obligations imposed by this License are for the benefit
    of the Initial Contributor and any Recipient, and each Recipient
    acknowledges and agrees that the Initial Contributor and/or any
    other Recipient may enforce the terms and conditions of this
    License against any Recipient.

    10.2. This License represents the complete agreement concerning
    subject matter hereof, and supersedes and cancels all previous oral
    and written communications, representations, agreements and
    understandings between the parties with respect to the subject
    matter hereof.

    10.3. The application of the United Nations Convention on Contracts
    for the International Sale of Goods is expressly excluded.

    10.4. The language in all parts of this License shall be in all
    cases construed simply according to its fair meaning, and not
    strictly for or against any of the parties hereto. Any law or
    regulation which provides that the language of a contract shall be
    construed against the drafter shall not apply to this License.

    10.5. If any provision of this License is invalid or unenforceable
    under the laws of the Governing Jurisdiction, it shall not affect
    the validity or enforceability of the remainder of the terms of
    this License, and without further action by the parties hereto,
    such provision shall be reformed to the minimum extent necessary to
    make such provision valid and enforceable.

    10.6. The paragraph headings of this License are for reference and
    convenience only and are not a part of this License, and they shall
    have no effect upon the construction or interpretation of any part
    hereof.

    10.7. Each of the terms "including", "include" and "includes", when
    used in this License, is not limiting whether or not non-limiting
    language (such as "without limitation" or "but not limited to" or
    words of similar import) is used with reference thereto.

    10.8. The parties hereto acknowledge they have expressly required
    that this License and notices relating thereto be drafted in the
    English language.

//***THE LICENSE TERMS END HERE (OTHER THAN AS SET OUT IN EXHIBIT
//A).***//

EXHIBIT A (to the Adaptive Public License)

    PART 1: INITIAL CONTRIBUTOR AND DESIGNATED WEB SITE The Initial
    Contributor is:
    	Amin Gholiha 
    

    The Designated Web Site is:
    	www.codeproject.com


    NOTE: The Initial Contributor is to complete this Part 1, along
    with Parts 2, 3, and 5, and, if applicable, Parts 4 and 6.

    PART 2: INITIAL WORK

    The Initial Work comprises the computer program(s) distributed by
    the Initial Contributor having the following title(s):

    Amin Gholiha, developer. 

    The date on which the Initial Work was first available under this
    License: 2005-01-01

    PART 4: THIRD PARTIES

    For the purposes of this License, "Third Party" has the definition
    set forth below in the ONE paragraph selected by the Initial
    Contributor from paragraphs A, B, C, D and E when the Initial Work
    is distributed or otherwise made available by the Initial
    Contributor. To select one of the following paragraphs, the Initial
    Contributor must place an "X" or "x" in the selection box alongside
    the one respective paragraph selected. SELECTION BOX 	PARAGRAPH
    [  ] 	A. "THIRD PARTY" means any third party.

    [  ] 	B. "THIRD PARTY" means any third party except for any of
    the following: (a) a wholly owned subsidiary of the Subsequent
    Contributor in question; (b) a legal entity (the "PARENT") that
    wholly owns the Subsequent Contributor in question; or (c) a wholly
    owned subsidiary of the wholly owned subsidiary in (a) or of the
    Parent in (b).

    [  ] 	C. "THIRD PARTY" means any third party except for any of
    the following: (a) any Person directly or indirectly owning a
    majority of the voting interest in the Subsequent Contributor or
    (b) any Person in which the Subsequent Contributor directly or
    indirectly owns a majority voting interest.

    [  ] 	D. "THIRD PARTY" means any third party except for any
    Person directly or indirectly controlled by the Subsequent
    Contributor. For purposes of this definition, "control" shall mean
    the power to direct or cause the direction of, the management and
    policies of such Person whether through the ownership of voting
    interests, by contract, or otherwise.

    [  ] 	E. "THIRD PARTY" means any third party except for any
    Person directly or indirectly controlling, controlled by, or under
    common control with the Subsequent Contributor. For purposes of
    this definition, "control" shall mean the power to direct or cause
    the direction of, the management and policies of such Person
    whether through the ownership of voting interests, by contract, or
    otherwise.

    The default definition of "THIRD PARTY" is the definition set forth
    in paragraph A, if NONE OR MORE THAN ONE of paragraphs A, B, C, D
    or E in this Part 4 are selected by the Initial Contributor.

    PART 5: NOTICE

    THE LICENSED WORK IS PROVIDED UNDER THE TERMS OF THE ADAPTIVE
    PUBLIC LICENSE ("LICENSE") AS FIRST COMPLETED BY:
    ______________________ [Insert the name of the Initial Contributor
    here]. ANY USE, PUBLIC DISPLAY, PUBLIC PERFORMANCE, REPRODUCTION OR
    DISTRIBUTION OF, OR PREPARATION OF DERIVATIVE WORKS BASED ON, THE
    LICENSED WORK CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS LICENSE
    AND ITS TERMS, WHETHER OR NOT SUCH RECIPIENT READS THE TERMS OF THE
    LICENSE. "LICENSED WORK" AND "RECIPIENT" ARE DEFINED IN THE
    LICENSE. A COPY OF THE LICENSE IS LOCATED IN THE TEXT FILE ENTITLED
    "LICENSE.TXT" ACCOMPANYING THE CONTENTS OF THIS FILE. IF A COPY OF
    THE LICENSE DOES NOT ACCOMPANY THIS FILE, A COPY OF THE LICENSE MAY
    ALSO BE OBTAINED AT THE FOLLOWING WEB SITE:
    ___________________________________________________ [Insert Initial
    Contributor's Designated Web Site here]

    Software distributed under the License is distributed on an "AS IS"
    basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
    the License for the specific language governing rights and
    limitations under the License.

    PART 6: PATENT LICENSING TERMS

    For the purposes of this License, paragraphs A, B, C, D and E of
    this Part 6 of Exhibit A are only incorporated and form part of the
    terms of the License if the Initial Contributor places an "X" or
    "x" in the selection box alongside the YES answer to the question
    immediately below.

    Is this a Patents-Included License pursuant to Section 2.2 of the
    License?

        YES 	[      ] NO 	[      ]

    By default, if YES is not selected by the Initial Contributor, the
    answer is NO.

        A. For the purposes of the paragraphs in this Part 6 of Exhibit
        A, "LICENSABLE" means having the right to grant, to the maximum
        extent possible, whether at the time of the initial grant or
        subsequently acquired, any and all of the rights granted
        herein.

        B. The Initial Contributor hereby grants all Recipients a
        world-wide, royalty-free, non-exclusive license, subject to
        third party intellectual property claims, under patent claim(s)
        Licensable by the Initial Contributor that are or would be
        infringed by the making, using, selling, offering for sale,
        having made, importing, exporting, transfer or disposal of such
        Initial Work or any portion thereof. Notwithstanding the
        foregoing, no patent license is granted under this Paragraph B
        by the Initial Contributor: (1) for any code that the Initial
        Contributor deletes from the Initial Work (or any portion
        thereof) distributed by the Initial Contributor prior to such
        distribution; (2) for any Modifications made to the Initial
        Work (or any portion thereof) by any other Person; or (3)
        separate from the Initial Work (or portions thereof)
        distributed or made available by the Initial Contributor.

        C. Effective upon distribution by a Subsequent Contributor to a
        Third Party of any Modifications made by that Subsequent
        Contributor, such Subsequent Contributor hereby grants all
        Recipients a world-wide, royalty-free, non-exclusive license,
        subject to third party intellectual property claims, under
        patent claim(s) Licensable by such Subsequent Contributor that
        are or would be infringed by the making, using, selling,
        offering for sale, having made, importing, exporting, transfer
        or disposal of any such Modifications made by that Subsequent
        Contributor alone and/or in combination with its Subsequent
        Work (or portions of such combination) to make, use, sell,
        offer for sale, have made, import, export, transfer and
        otherwise dispose of:

            (1) Modifications made by that Subsequent Contributor (or
            portions thereof); and

            (2) the combination of Modifications made by that
            Subsequent Contributor with its Subsequent Work (or
            portions of such combination);

        (collectively and in each case, the "SUBSEQUENT CONTRIBUTOR
        VERSION").

        Notwithstanding the foregoing, no patent license is granted
        under this Paragraph C by such Subsequent Contributor: (1) for
        any code that such Subsequent Contributor deletes from the
        Subsequent Contributor Version (or any portion thereof)
        distributed by the Subsequent Contributor prior to such
        distribution; (2) for any Modifications made to the Subsequent
        Contributor Version (or any portion thereof) by any other
        Person; or (3) separate from the Subsequent Contributor Version
        (or portions thereof) distributed or made available by the
        Subsequent Contributor.

        D. Effective upon distribution of any Licensed Work by a
        Distributor to a Third Party, such Distributor hereby grants
        all Recipients a world-wide, royalty-free, non-exclusive
        license, subject to third party intellectual property claims,
        under patent claim(s) Licensable by such Distributor that are
        or would be infringed by the making, using, selling, offering
        for sale, having made, importing, exporting, transfer or
        disposal of any such Licensed Work distributed by such
        Distributor, to make, use, sell, offer for sale, have made,
        import, export, transfer and otherwise dispose of such Licensed
        Work or portions thereof (collectively and in each case, the
        "DISTRIBUTOR VERSION"). Notwithstanding the foregoing, no
        patent license is granted under this Paragraph D by such
        Distributor: (1) for any code that such Distributor deletes
        from the Distributor Version (or any portion thereof)
        distributed by the Distributor prior to such distribution; (2)
        for any Modifications made to the Distributor Version (or any
        portion thereof) by any other Person; or (3) separate from the
        Distributor Version (or portions thereof) distributed or made
        available by the Distributor.

        E. If Recipient institutes patent litigation against another
        Recipient (a "USER") with respect to a patent applicable to a
        computer program or software (including a cross-claim or
        counterclaim in a lawsuit, and whether or not any of the patent
        claims are directed to a system, method, process, apparatus,
        device, product, article of manufacture or any other form of
        patent claim), then any patent or copyright license granted by
        that User to such Recipient under this License or any other
        copy of this License shall terminate. The termination shall be
        effective ninety (90) days after notice of termination from
        User to Recipient, unless the Recipient withdraws the patent
        litigation claim before the end of the ninety (90) day period.
        To be effective, any such notice of license termination must
        include a specific list of applicable patents and/or a copy of
        the copyrighted work of User that User alleges will be
        infringed by Recipient upon License termination. License
        termination is only effective with respect to patents and/or
        copyrights for which proper notice has been given.

    PART 7: SAMPLE REQUIREMENTS FOR THE DESCRIPTION OF DISTRIBUTED
    MODIFICATIONS

    Each Subsequent Contributor (including the Initial Contributor
    where the Initial Contributor qualifies as a Subsequent
    Contributor) is invited (but not required) to cause each Subsequent
    Work created or contributed to by that Subsequent Contributor to
    contain a file documenting the changes such Subsequent Contributor
    made to create that Subsequent Work and the date of any change.

//***EXHIBIT A ENDS HERE.***// 

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Program Manager
Sweden Sweden
Amin Gholiha.
Education:
- Master of Science in Information Technology.
- Degree of Master of Education.
Knowledge/interest: programming (.NET,Visual, C#/C++), neural network, mathematical modeling, signal processing, sequence analysis, pattern recognition,robot technology, system design, security and business management systems. For business proposal email Gholiha@rocketmail.com, all other emails will be ignored.
Current Work:
Project Manager
www.easysoft.nu (the best free e-signature tool)

Comments and Discussions