Document:

<PAGE>
                                                                   EXHIBIT 10.31

                            SHARE PURCHASE AGREEMENT

This Agreement is made this 3rd of October, 2006 between Twinstar Infrastructure
Limited, a Company registered in Port Louis, Mauritius, represented by its
Director Shri Agnivesh Agarwal, hereinafter called the Party of the First Part
(which expression shall unless repugnant to the context be deemed to include its
administrators, executors and assigns) and Sterlite Industries (India) Limited,
a Company registered in India represented by its Director Shri Tarun Jain,
hereinafter called the Party of the Second Part (which expression shall unless
repugnant to the context be deemed to include its administrators, executors and
assigns).

Whereas the Party of the First Part is holding 49,348 (forty nine thousand three
hundred forty eight) equity shares of Rs.100/- each of Sterlite Energy Limited,
a Company registered in India under the Indian Companies Act, 1956 with 49,344
(forty nine thousand three hundred forty four) shares being held and registered
in its name and 4(four) shares being registered in the name of its nominees
namely 1) Kiran Agarwal; 2) Vedvati Agarwal; 3) Agnivesh Agarwal and 4)Praveen
Agarwal holding 1 share each.

                                                                               1
<PAGE>
Whereas the said Sterlite Energy Limited is in the process of setting up a mega
Power plant of 2400 MW in the State of Orissa and has committed substantial
investment in the said Project and the Present promoters of Sterlite Energy
Limited do not want to pursue the project any more.

Whereas the promoters of the Party of the Second Part have experience and
expertise in setting up such mega projects and have expressed its willing and
agreed to buy the entire shareholding of the Party of the First Part in the
said Sterlite Energy Limited on the terms and conditions hereinafter appearing.

Now this indenture witnesseth as follows:-

     1. That the Party of the First part hereby agrees to sell and transfer
        49,348 equity shares (including 4 equity shares held by its nominees) of
        Rs. 100/- each to the Party of the Second Part at a consideration of
        Rs. 100/- per share.

     2. That the Party of the Second part has agreed to pay a sum of
        Rs. 49,34,800/- (Rupees forty nine lacs thirty four thousand eight
        hundred only) to the Party of the First part in lieu of said shares
        purchased by it and has paid the said amount to the Party of the First
        part by way of Cheque No. 084786 dated 3.10.06 drawn on ICICI Bank,
        Tuticorin.

     3. That the Party of the first Part acknowledges the receipt of the said
        sum of Rs. 49,34,800/-(Rupees forty nine lacs thirty four thousand
        eight hundred only).

     4. That the Party of the Second Part has hereby handed over the following
        share certificates along with duly executed share transfer deeds which
        the party of the Second part hereby acknowledges and confirms.

<TABLE>
<Caption>

        S1.       SHARE CERTIFICATE NO.      DISTINCTIVE NOS      NO OF SHARES
                                             FROM        TO
<S>               <C>                        <C>         <C>      <C>

        1.                 4                 3           49346        49344
        2.                 5                 49347       49347        1
        3.                 6                 49348       49348        1
        4.                 7                 49349       49349        1
        5.                 8                 49350       49350        1
                                             TOTAL                    49348
</TABLE>

     5. That the Party of the first part hereby confirms that the shares being
        sold and transferred herein are free from all encumbrances, charges etc
        and have not been pledged or mortgaged and are available for sale.

                                                                               2
<PAGE>
     6.  That the Party of the First part hereby confirms that the shares being
         sold herein were acquired by it on Non-repatriation basis under the
         general permission of Reserve Bank of India.

     7.  That the Party of the First part hereby confirms that all the
         applicable taxes in respect of the present shares will be borne by the
         Party of the First Part only and the Party of the Second part shall in
         no way be responsible for any kind of taxes whatsoever.

     8.  That the Party of the Second Part agrees to deliver information in
         regard to the present transaction to the Reserve Bank of India in the
         relevant form within the time as applicable.

     9.  That both the parties hereby confirm that they shall further record any
         deed or recitation if needed.

     10. That if any difference or dispute arises in between the parties herein,
         the same shall be governed by the Jurisdiction of the Mumbai High
         Court.

In witness whereof the parties have subscribed their hands on the day, month and
the year above first written.

Witness:-

<Table>

<S>       <C>                       <C>

1.        /s/ V. S. Ganesh              For Twinstar Infrastructure Limited
          (V. S. Ganesh)

                                        /s/ Agnivesh Agarwal
                                        (Agnivesh Agarwal)
                                        Director
                                        (PARTY OF THE FIRST PART)

2.        /s/ M. Joshi
          [M. Joshi]                    For Sterlite Industries(India)Limited

                                        /s/ Tarun Jain
                                        (Tarun Jain)
                                        Director
                                    (PARTY OF THE SECOND PART)
</TABLE>

                                                                               3EXHIBIT 10.1

                        RELEASE AND SETTLEMENT AGREEMENT
                        --------------------------------

                This Release and Settlement Agreement (the "Agreement") is
hereby entered into as of the __th day of _________, 2006 by and between the
following parties:
                 A. CompuDyne Corporation, including any of its predecessors,
successors, subsidiaries and present and former officers, directors, employees,
assigns, and persons acting on their behalf (collectively, "CompuDyne");
                 B. William Blair Mezzanine Capital Fund II, L.P. including any
of its predecessors, successors, subsidiaries and present and former officers,
directors, employees, assigns, and persons acting on their behalf (collectively,
"Blair"); and
                 C. Friedman, Billings, Ramsey Group, Inc., including any of its
predecessors, successors, subsidiaries and present and former officers,
directors, employees, assigns, and persons acting on their behalf (collectively,
"FBR") (CompuDyne, Blair and FBR are collectively referred to herein as the
"Parties").
                WHEREAS, on September 12, 2001, CompuDyne and FBR entered into
an agreement, which was amended on September 27, 2001, whereby FBR agreed to
act as financial advisor and lead underwriter in connection with the private
placement of two million four hundred fifty thousand (2,450,000) shares of
CompuDyne common stock (the "Offering");
                WHEREAS, CompuDyne and FBR have expressed a desire to engage
in future business dealings and recognize that resolving the issues covered by
this Agreement will foster the ability to engage in future business dealings;
                WHEREAS, the Parties do not admit that liability or wrongdoing
of any kind occurred in connection with the Offering.

<PAGE>

                WHEREAS, the Parties mutually desire to enter into a full and
final settlement of all claims that the Parties have or may have against one
another, from the beginning of time to the date of this Agreement, including
without limitation any and all claims arising out of or relating to the
Offering, or arising out of or relating to FBR's alleged trading in shares of
CompuDyne common stock (CDCY);
                NOW, THEREFORE, in consideration of mutual covenants contained
herein, it is agreed by and between the Parties as follows:
                1. FBR shall make the following payments to CompuDyne, for the
benefit of CompuDyne and Blair:
                    a. FBR shall pay to CompuDyne any amounts directed to be
paid by FBR to CompuDyne and/or Blair pursuant to a settlement between FBR and
the United States Securities and Exchange Commission (the "SEC") in In the
Matter of Friedman, Billings, Ramsey & Co., Inc. (the "SEC Settlement"); and
                    b. FBR shall pay to CompuDyne two million three hundred
thirty three thousand nine hundred fifty nine dollars ($2,333,959), within two
business day's following the execution of this Agreement by all Parties, by wire
transfer pursuant to wiring instructions to be provided by CompuDyne.
                2. In the event that the total amount paid by FBR to CompuDyne
and/or Blair pursuant to Paragraph 1 of this Agreement is less than four million
five hundred thousand dollars ($4,500,000), FBR shall pay the difference to
CompuDyne at such time as the SEC-directed funds are paid to CompuDyne, by wire
transfer pursuant to wiring instructions to be provided by CompuDyne.

                                       2

<PAGE>

                 3. In the event that the total amount paid by FBR to CompuDyne
and/or Blair pursuant to Paragraph 1 of this Agreement exceeds four million five
hundred thousand dollars ($4,500,000), CompuDyne and Blair agree to deduct any
amount paid in excess of four million five hundred thousand dollars ($4,500,000)
from the amount paid to CompuDyne pursuant to Paragraph 1(b) of this Agreement,
and CompuDyne and Blair further agree to return promptly such excess amounts up
to two million three hundred thirty three thousand nine hundred fifty nine
dollars ($2,333,959) to FBR. Except as provided in this paragraph, neither
CompuDyne nor Blair shall have any obligation to pay any amounts to FBR under
this Agreement.
                 4. In the event the SEC determines not to require FBR to make
any payment to CompuDyne and/or Blair in In the Matter of Friedman, Billings,
Ramsey & Co., Inc., within two business days of receiving such notice from the
SEC, FBR shall pay $2,166,041 to CompuDyne, by wire transfer pursuant to wiring
instructions to be provided by CompuDyne.
                 5. The Parties hereby enter into the following releases:
                    a. CompuDyne and Blair, for themselves, their predecessors,
successors, insurers, attorneys and present and former agents, servants,
principals, directors, owners, officers, employees and assigns, hereby fully,
finally, and forever release and discharge FBR, from any and all claims, rights,
debts, liabilities, charges, losses, demands, acts, costs, attorneys' fees,
damages, suits, and causes of action of whatsoever kind, whether now known or
unknown and whether or not suspected or unsuspected, contingent or fixed, that
CompuDyne and Blair now have or may have against FBR, from the beginning of time
through the date of this Agreement, including without limitation any and all
claims, rights, debts, liabilities, charges, losses, demands, acts, costs,
attorneys' fees, damages, suits, and causes of action arising out of or relating
to: (i) the Offering; (ii) any transaction(s) in CompuDyne securities prior to
the date of

                                       3

<PAGE>

this Agreement; or (iii) any other financial transaction related to CompuDyne
entered into prior to the date of this Agreement, provided however, that: (i) no
release of FBR for any claim by CompuDyne and/or Blair shall take effect until
after FBR has discharged its obligations to CompuDyne and/or Blair pursuant to
the SEC Settlement; and (ii) this release shall have no force or effect with
respect to claims that Blair or CompuDyne may have against persons other than
FBR in connection with such person's trading in CompuDyne stock.
                    b. FBR, for itself, its predecessors, successors, insurers,
attorneys and present and former agents, servants, principals, directors,
owners, officers, employees and assigns, hereby fully, finally, and forever
releases and discharges CompuDyne and Blair from any and all claims, rights,
debts, liabilities, charges, losses, demands, acts, costs, attorneys' fees,
damages, suits, and causes of action of whatsoever kind, whether now known or
unknown and whether or not suspected or unsuspected, contingent or fixed, that
FBR now has or may have against CompuDyne and Blair, from the beginning of time
through the date of this Agreement, including without limitation any and all
claims, rights, debts, liabilities, charges, losses, demands, acts, costs,
attorneys' fees, damages, suits, and causes of action arising out of or relating
to: (i) the Offering; (ii) any transaction(s) in CompuDyne securities prior to
the date of this Agreement; or (iii) any other financial transaction related to
CompuDyne entered into prior to the date of this Agreement, provided however,
that no release of CompuDyne and/or Blair for any claim by FBR shall take effect
until after FBR has discharged its obligations to CompuDyne and/or Blair
pursuant to the SEC Settlement.

                  6. From the date of this Agreement until the date the releases
in Paragraph 5 become effective, CompuDyne and Blair agree not to commence any
litigation against FBR, and FBR agrees not to commence any litigation against
CompuDyne or Blair, arising out of or

                                       4

<PAGE>

relating to any fmancial transactions related to CompuDyne entered into prior to
the date of this Agreement, including without limitation any and all claims
covered by the releases in Paragraph 5.
                 7. Within two business days following the execution of this
Agreement by all Parties, FBR shall return, or cause to be returned, to
CompuDyne the 40,000 warrants, which have no value, issued to FBR in connection
with its work on the Offering. Upon receipt of the warrants, CompuDyne shall
promptly cause the warrants to be cancelled.
                 8. Any controversy or claim arising out of or relating to this
Agreement, or the breach thereof, including any disputes as to arbitrability,
shall be settled by any means mutually agreed upon by the Parties. In the
absence of any such agreement, it shall be settled by arbitration in accordance
with the Commercial Arbitration Rules of the American Arbitration Association,
and judgment upon the award rendered by the arbitrators may be entered in any
court having jurisdiction thereof.
                    a. The place of arbitration shall be Washington, D.C., and
the arbitration tribunal shall consist of three (3) arbitrators, of whom one
shall be nominated by each of the parties and the third, who shall serve as
chairman, shall be chosen by the two party-nominated arbitrators or, in the
event the party-nominated arbitrators are unable or unwilling to designate the
third arbitrator, by the American Arbitration Association.
                    b. The award of the arbitrators shall be fmal and binding.
The Parties waive any right to appeal the arbitral award, to the extent the
right to appeal may be lawfully waived. Each Party retains the right to seek
judicial assistance: (i) to compel or aid arbitration; (ii) to obtain interim
measures of protection pending arbitration, including equitable relief; or (iii)
to enforce any decision of the arbitrators, including the fmal award.

                                       5

<PAGE>

                 9. Each of the Parties represents and warrants that it has read
this Agreement and that it is authorized to enter into this Agreement. Each
Parry represents that it has made such investigation of the facts pertaining to
this Agreement as they deem necessary and desirable and have received
independent legal and business advice with respect to the advisability of
executing this Agreement.
                 10. This Agreement is fmal and binding and inures to the
benefit of each of the Parties together with their respective successors,
transferees and assigns. No modification or waiver of any provision of this
Agreement is effective unless agreed to, in writing, by all of the affected
Parties.
                 11. Any notice, demand, consent, approval, request, or other
communication required or permitted to be given hereunder shall be in writing
and delivered either personally to the persons specified below, or by overnight
express mail, as follows:

                 If to CompuDyne or Blair:

                 Jeffrey A. Klafter, Esq.
                 Kurt B. Olsen, Esq.
                 Klafter & Olsen LLP
                 1250 Connecticut Avenue, N.W., Suite 200
                 Washington, D.C. 20036

                 If to the FBR:

                 Howard W. Gutman, Esq.
                 Steven M. Farina, Esq.
                 Williams & Connolly LLP
                 725 Twelfth Street, N.W.
                 Washington, D.C. 20005

                                       6

<PAGE>
                 Copy to:

                 William J. Ginivan
                 Chief Legal Officer
                 Friedman, Billings, Ramsey Group, Inc.
                 1001 Nineteenth Street North
                 Arlington, VA 22209

                 12. This Agreement may be executed in identical counterparts.
Each counterpart hereof is deemed to be an original instrument, but all
counterparts hereof taken together constitute a single document. Facsimile
signatures are deemed originals.
                 13. The Parties agree to execute any and all documents
reasonably necessary to implement the terms and provisions of the Agreement.
                 14. This Agreement was mutually drafted and agreed upon and
should not be construed against any Party.
                 IN WITNESS WHEREOF, the Parties hereto have caused this
Agreement to be executed by each of them or their duly authorized
representatives as of the date first noted above.

                                     COMPUDYNE CORPORATION, by its
                                     Authorized Agent:

                                     -----------------------------------------
                                     Printed Name:
                                     Title:

                                     WILLIAM BLAIR MEZZANINE
                                     CAPITAL FUND II, L.P., by its Authorized
                                     Agent:

                                     -----------------------------------------
                                     Printed Name:
                                     Title:

                                       7

<PAGE>

                                     FRIEDMAN, BILLINGS, RAMSEY
                                     GROUP, INC., by its Authorized Agent:

                                     Printed Name:
                                     Title:
                                     -----------------------------------------

                                       8

Source: [{"source": "alea-institute/alea-institute/kl3m-data-edgar-agreements/train-00113-of-00352.parquet"}, [{"source": "alea-institute/alea-institute/kl3m-data-edgar-agreements/train-00113-of-00352.parquet"}]]