联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Python编程Python编程

日期:2024-12-15 09:21

03CIT4057 Introduction to Computer Programming

Project

Overview:

The project will be 30% of overall grade of the course.

The project is done by team. Each team is formed by 3‑5 students.

Background:

In cryptography, a Caesar cipher is one of the simplest and most widely known encryption techniques. It is a

type of substitution cipher in which each letter in the plaintext is replaced by a letter some ffxed number of

positions down the alphabet.

For example, with a left shift of 3, D would be replaced by A, E would become B, and so on.

The Caesar cipher is named after Julius Caesar, who, according to Suetonius, used it with a shift of three (A be‑

coming D when encrypting, and D becoming A when decrypting) to protect messages of military signiffcance.

While Caesar’s was the ffrst recorded use of this scheme, other substitution ciphers are known to have been

used earlier.

2Speciffcation:

‧ Decrypt a Caesar cipher encrypted text.

‧ The encrypted text is stored in a ffle.

‧ The program reads the ffle and shows the text after decryption.

Bonus:

‧ Establish a web server which accepts the encrypted message and then present the decrypted text.

Double bonus:

‧ In additional of the manual input, the webserver accepts encrytped text and returns the decrypted text

in JSON format.

Deliverables:

Group work:

For every item below, 1 group submits 1 copy only.

1. The group should submit the source code to the GitHub group repository.

2. Powerpoint for the presentation. The PPT SHOULD include the member list. The group should submit

the PPT to the Blackboard.

Individual work:

For every item below, every student should submit 1 copy.

3. Student must do a peer review for every member in the group. He/she should ffll the 360 review form and

submit it to the Blackboard.

3Due date

All items mentioned in the Section Deliverables should be submitted on or before

2024‑12‑18 23:59:59.

Presentation:

Each team will present their project in the last class.

4Appendix A:

Breaking The Cipher:

To look for the “shift”, you need to know the following technique about cracking Caesar ciphers that has

been around for over a thousand years.

Any language such as English has a known distribution for each letter.

For example,

the letter “E” is the most common letter in English making up about 12% of the letters on average (ignoring

case). The letter “T” is next (about 9%), followed by “A” ( about 8%), and so on. But the point is that only

the order “E”, “T” and “A” does matter, not the percentage.

The procedure begins by ffnding the most common letter. You can guess that the most common letter maps

to “E.” You can now ffnd the “shift” from the most common letter in the cipher‑text to the expected most

common letter “E”.

For example,

if the most common letter in the cipher‑text is “H”, you know that the shift from “E” to “H” is 3. You

should check that the shift for the next most common letter “T”, and third most common letter “A” is also

3. Once you know the shift, you can apply the shift to all the letters in the cipher‑text and get the original

plain‑text message.

What about spaces between words and punctuation?

In the real world, there is no space or punctuation in a cipher‑text. The reason is that those are useful clues

for deciphering.

However, there are spaces in the cipher‑text for this project because they will be helpful for you to recognize

that your deciphering is correct or not. But you will need to ignore spaces when counting letters (if you forget

to ignore them, beware that the space will be the most common character).

The suggested algorithm will be:

1. Read the cipher‑text.

2. Get a count of each character in the entire cipher‑text (ignore spaces).

3. Find the most common character.

4. Find the shift from “E” to that most common character.

5. Check that the shift also works for the next most common.

6. Using the shift, decode each character of the cipher‑text and print.

5


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp