联系方式

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

您当前位置:首页 >> C/C++编程C/C++编程

日期:2018-09-25 10:39

Information Systems Security and Protection

Beijing Jiao Tong University

Homework 2 (10% of final grade)

Coding for Encryption/Decryption Algorithms

Submission Deadline: 23:59:59, Sept 28.

You can write in C/C#/Java/Python/MATLAB, etc.

1. Substitution Ciphers

In Substitution cipher, each letter in the plaintext is replaced by a letter having some fixed

number of positions down/or up the alphabet.

? Example:

Please implement Encrypt(Letter, Key) and Decrypt(Letter, Key). Key is the input

parameter, which can be defined by users. For example, when Key=3,

Encrypt(“HELLO”,3) = “KHOOR”, and Decrypt(“KHOOR”,3) = “HELLO”. Key can be

other values.

2. Transposition Cipher

In transposition cipher, the message is encrypted by rearranging the letter order, i.e., write

letters out diagonally over a number of rows, then read off cipher row by row. For

example, the plain text “meet after the toga party”, can be written out as:

? m e m a t r h t g p r y

? e t e f e t e o a a t

if the cipher text is written in two rows.

Please implement Encrypt(Letter, Key) and Decrypt(Letter, Key), with Key as how many

rows are there in cipher text.

3. Product Ciphers

2

We define Product Cipher as the Function of Boolean algebra: two bits are compared. If

two bits are identical, the result is binary 0; If two bits are not identical, the result is

binary 1, shown as in the following figure.

Please implement Encrypt(Letter, Key) and Decrypt(Letter, Key), with Key as defined by

users.

Submission:

Zip all C codes, submit it to Class Representative before deadline.


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

python代写
微信客服:codinghelp