Write a class supercrypt that is a subclass of crypt

Assignment Help Computer Engineering
Reference no: EM132116100

Problem

For this problem, you will use threading to speed up a decryption process. There exists a class called Crypt with a static method decrypt. The decrypt method takes a string and returns a non-zero value if the string can be decrypted successfully and 0 otherwise.

You do not need to implement the decrypt method. Its implementation already exists.

The Crypt class takes and array of string keys and the check methods simply calls decrypt on each of those strings, returning immediately if decrypt was successful. See code below. However, the Decrypting is a slow process so you want to convert this to a multithreaded program.

Write a class SuperCrypt that is a subclass of Crypt that can use multiple CPUs to fo decryption concurrently. As always, you are free to add ivars, methods, inner class and so on.

In its constructor, SuperCrypt takes an array of String keys to try. (code provided)

The check() methods should fork off 4 worker threads, Collectively, the workers should try to decrypt all the keys. The check() methods should return 0 if all of the decrypts return 0. If a key decrypts successfully(non-zero), then check() should return its non-zero code. check() should return immediately when a non-zero code is found.

When a successful decrypts is found, we could interrupt() the other workers. However, we will not do this. It is acceptable to allow the other workers to continue to run the completion.

Reference no: EM132116100

Questions Cloud

Why is quadruple precision more than twice : Why is quadruple precision (128 bits) more than twice as accurate as double precision (64-bit).
Manage a hedge fund : You manage a hedge fund with $400 million in assets. Your fee structure provides for a 1% annual management fee with a 20% incentive on returns
What is the operating cash flow : That is, the depreciation each year will be $128190/14. Assuming a tax rate of 26%, what is the operating cash flow?
Is quality simply a matter of coordinating excellent : Is quality simply a matter of coordinating excellent organizational effort? Can quality be simplified to this degree? Or is quality about much more?
Write a class supercrypt that is a subclass of crypt : For this problem, you will use threading to speed up a decryption process. There exists a class called Crypt with a static method decrypt.
How much is each worth today : Sara invested $950 at the same time, but her investment paid 8% compounded quarterly. How much is each worth today?
Draw an er diagram that captures the preceding information : The Prescriptions-R-X chain of pharmacies has offered to give you a free lifetime supply of medicine if you design its database.
Who is the proponent of theory of economic rhythm : Who is the proponent of theory of economic rhythm, action and reaction approach, time lag method and model building approach
Information for golden fleece financial : 1. Following information for Golden Fleece Financial:

Reviews

Write a Review

Computer Engineering Questions & Answers

  How can the type of a variable be determined

What are the three ways the value of a variable can be explicitly converted to a specific type? How can the type of a variable be determined?

  Write down a shell program

-Check if there is exactly 2 filenames, if not, printout error message

  Develop a site structure diagram using word

Develop a site structure diagram using Word, PowerPoint or any other tool that you feel comfortable with. The top level of hierarchy should only show home page.

  Why should you write and install the program

You worry that this system gives an unfair advantage to patients with last names that start with A, B, C, and D. Why should you write and install the program?

  Make use of a for loop to step through all 32 bits

The bitwise-manipulation operators perform simultaneous bit manipulations and enable programs to process large quantities of binary information well.

  What is the time complicity for each of them in the worst

Suppose that A is a problem belonging to P-Class and B is a problem to NP-Class. Does A belong to NP-Class? Does B belong to P-Class?

  How many books are sold each month by the publisher

Which authors are the biggest sellers of books in our stores? This is important because the publisher offers discounts for certain authors each month.

  When is off-line programming normally used

Timers and counters use words of memory, but contacts, coils, and branch start instructions do not.

  Recommend two 2 factors which would affect the decision to

q1. suggest two 2 factors that would influence the decision to disable bridge all site links as part of the site

  Create an initial researched and cited discussion response

Create an initial researched and cited discussion response early in the week about the topic you choose and follow with at least two researched.

  What is meant by active termination

What is the reflection coefficient for a bus with a characteristic impedance of 75 U and a termination of 200 fl?

  Make a professional-looking document

though, if you have a one page article and a one page summary, then the score would still be high, but may also indicate that you need to use more of your own words in the summary. Also as a reminder, whenever, you copy the words of another author..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd