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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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