Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8401281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:45:56+00:00 2026-06-09T21:45:56+00:00

I am creating a program that I will use to help my customers recover

  • 0

I am creating a program that I will use to help my customers recover passwords placed on office documents like word and excel. The program works just fine but it is MUCH slower than similar products that you can download for free. I would like to use my own program because I feel like a lot of the ones you download for free aren’t completely safe and lack some of the controls that I would like to have.

More to the point… I need help figuring out why my program is so much slower. I created an excel document with a simple 3 letter password “TFX”. The program I downloaded find the password almost as fast as I can let go of the mouse button after clicking on ‘go’. My program takes 10 minutes. Here’s the 3 character loop:

  private string ThreeCharPass(string file, Microsoft.Office.Interop.Excel.Application exApp, char[] combarr)
    {
        for (int three = 0; three < combarr.Length; three++)
        {
            for (int two = 0; two < combarr.Length; two++)
            {
                for (int one = 0; one < combarr.Length; one++)
                {
                    try
                    {
                        string pass = combarr[three].ToString() + combarr[two].ToString() + combarr[one].ToString();
                        exApp.Workbooks.Open(file, false, true, Type.Missing, pass, Type.Missing, true, Type.Missing, Type.Missing, false, false, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
                        return pass;
                    }
                    catch
                    {
                    }
                }
            }
        }
        return string.Empty;
    }

The array ‘combarr’ is an array of chars containing all the possible characters in the password. It’s generated earlier in the program based on user selected options. I’m thinking the issue has to be in the way I’m looping through the array to create the password combinations because just in this 3 character password method it spends more than 5 minutes where other ‘professional’ programs spend seconds. Any feedback would be greatly appreciated!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:45:58+00:00Added an answer on June 9, 2026 at 9:45 pm

    There are some minor optimizations that you could do on your code, but the most likely culprit is the exApp.Workbooks.Open call. I think that call is very slow, but you could test that with a profiler.

    What other tools do is to read the actual document structure (DOC, DOCX format) and figure out whether the password is correct the exact same way that Word would try to figure it out. I don’t know the exact details, but it is very likely that there is a way by which Word knows that the password was correct. An example could be a unique string that, when decrypted correctly, has the expected value; or a checksum that adds up. When you know the specification of the format, you can do that test yourself, saving you the expensive interop call.

    This page has detailed information about many of the Microsoft Office formats. It is a lot of work to implement parts of those specifications, but it will surely speed things up. Only once you’ve removed the interop call, you could take a look at more efficient loops, multithreading, and other strategies.

    Note that the Office formats are proprietary, so not all information may be available, complete, up-to-date or reliable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a variant of a chess-like program that needs to simultaneously generate and
I want to write an app that will allow a program like iTunes which
Ok so I am creating a program that makes use of a dbgrid and
I'm creating my first android app that will make use of SQlite. I have
I'm currently creating a fullscreen Java application that will be like a kiosk application.
I have been tasked with creating a program that will generate an amortization schedule.
I'm creating a program that will do a user-predefined number of tasks, say, 100.
I am creating a program that allows you to paste text but it will
Bassicly im creating a program that reads information from an xml file into a
I'm creating a program that authenticates from a before it runs. I also want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.