Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

INSTRUCTIONS FOR THIS PROJECT This project focuses mainly on materials learned in Chapter 4 and prior chapters. Python topics utilized in this project are: Strings

INSTRUCTIONS FOR THIS PROJECT

This project focuses mainly on materials learned in Chapter 4 and prior chapters.

Python topics utilized in this project are:

  • Strings
  • Text Files (reading and writing)
  • most materials from chapters 1-3

The project this week will be calculating the "Kasiski Method"

The algorithm for Kasiski is:

Find repeating characters of length 3 or more

Calculate the differences between the starting positions of the set of repeating characters

Factor the resulting values

The most frequent value is the result we are looking for

---------------------

Create a python script (file ending in .py) that performs the following steps:

  • Name your file YourNameScript4.py. Example: KenDeweyScript4.py
  • Gets input for the file provided into a string
  • Analyze the string, looking for repeating characters - (using substring and slicing is recommended)
  • Break string into pieces of length 15 using slicing along with a loop
  • Append each piece onto a list using .append() - covered in chapter 5 but shown here as well)
  • Output the repeating substring and the number of times it repeats.
  • The above is all this is required for this week.
  • Extra credit can be earned by
  • Determine the starting position of the repeating substring
  • Print out starting positions
  • Additional extra credit can be earned by
  • Determining and printout the factors of each number
  • Even more extra credit can be earned by
  • Printing out the common factors (don't include 1)

Sample:

Frequency of DDGBEMXBICCLISO is: 4 Above is all that is required for full credit. Each section below will earn extra credit. Starting Positions: 85, 385, 691, 1069 Difference between positions: 300, 306, 378 300: 2, 3, 4, 5, 6, 10, 12, 15, 20, 25, 30, 50, 60, 75, 100, 150, 300 306: 2, 3, 6, 9, 17, 18, 34, 51, 102, 153, 306 378: 2, 3, 6, 7, 9, 14, 18, 21, 27, 42, 54, 63, 126, 189, 378 Common Factors: 2, 3, 6

Refer to the example above, ensure your spacing matches the example perfectly.

Submit a document containing a screen shot of your code in its .py file along with a screenshot of the output.

Submit your .py file as well.

You will be submitting 2 files, a document and a .py file.

Kasiski text file is below.

DBGMSGISZDSYIVGDIKBQQWTNISTCIVJFKDCBHWVCYLTDGBXTXBKXKMDOVOGACCNYKRICKWTETAGXXTHSEEVXDDGBEMXBICCLISO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MTAUSWGDHCXEWWCELILISHPSKIOEDMOXHALYMDBGDLTIWUFIKNDTOGBHSFOXXGAKXMLIWEKRWACISGTA

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions