03CIT4057 Computer Programming

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 代写03CIT4057  Computer Programming 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.  
  

  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值