爱情鸟第一论坛com高清免费_91免费精品国自产拍在线可以看_亚洲一区精品中文字幕_男人操心女人的视频

CSC 172代寫、Java/C++程序設計代做

時間:2024-03-19  來源:  作者: 我要糾錯



CSC 172 – Project 1
• You may work on and submit your project individually or in groups of 2 students.
• If you work in a group you will have to prepare an extended README file to specify
who wrote each part of the code for maintaining clarity and transparency within the
group project.
• You are only allowed to cooperate with your group members, and you are not permitted
to share your solution with other students in any way.
Task
You will implement a cipher specified below using Java programming language. It shall
encrypt/decrypt text files including plaintext/ciphertext.
Background
1. Encryption is the process of encoding information or data in such a way that only
authorized parties can access it. This is typically done using algorithms and secret
keys to transform the original data into an unintelligible form known as ciphertext.
2. Plaintext refers to the original, unencrypted data or message that is intended to be
kept confidential.
3. Ciphertext refers to the encrypted form of data or information that has undergone
encryption.
Working with files
To encrypt content of a text file you have to:
• Read the file: open the file you want to encrypt and read its contents into memory.
• Convert to binary.
• Encrypt the data: use the presented encryption algorithm and the user secret key to
encrypt the data read from the file.
• Do NOT convert back to characters.
• Write encrypted data to file: save the encrypted data to a new file.
To decrypt content of a text file you have to:
1
• Read the file: open the file you want to decrypt and read its contents into memory
(content should be just long sequence of zeros and ones).
• Decrypt the data: use the presented decryption algorithm and the user secret key to
encrypt the data read from the file.
• Convert to characters.
• Write decrypted data to file: save the encrypted data to a new file.
1 Algorithm Description
The algorithm encrypts fixed number of bits only (64 bits). To encrypt longer input use the
simple ECB (Electronic Codebook) mode. Here’s how it works:
• Divide the data into blocks: the plaintext data is divided into fixed-size blocks of 64
bits.
• Apply encryption to each block independently: each block of plaintext is encrypted
independently using the same secret key and encryption algorithm. The same key is
used for each block.
• Output the encrypted blocks: the resulting ciphertext blocks are concatenated together
to form the complete ciphertext.
• If the last block doesn’t have enough bits, it needs to be padded to meet the required
block size. This process is known as padding. Use zero padding: append zero bits
to the end of the block until it reaches the required size. (Do not worry about extra
characters at the end when you decrypt.)
Include methods to encrypt/decrypt a single block of plaintext/ciphertext that implements the following symmetric-key encryption algorithm:
2
Your output shall be a block of 64 zeros and ones. (Do not represent the output block in a
Hex notation. If you do that you get -10%.) Encryption and decryption are almost the
same, but for decryption you need to use subkeys in a reverse order: k10, k9, ...k1
3
1. Input Splitting: The plaintext block of 64 bits is divided into two halves of 32 bits.
Let’s denote these halves as L0 and R0.
2. Round Function Application: In each round, a round function f is applied to one
half of the data, typically the right half Ri
, using the round key ki of 32 bits. The
result of the function is then XORed with the other half Li
.
Li+1 = Ri
Ri+1 = Li ⊕ f(Ri
, ki)
3. Swapping: After each round, the halves are swapped so that the left half becomes
the right half, and vice versa.
4. Iteration: Steps 2 and 3 are repeated 10 times.
5. Output Concatenation: After all rounds are completed, the final output consists of
the two halves (L10 and R10) concatenated together. This forms the ciphertext.
1.1 The f - function
The f - function (round function) works as follows:
1. XOR gate: The 32 input bits are XORed with the round key ki
.
2. Splitting: The 32 bits are divided into four pieces of 8 bits.
4
3. S-box: For each piece of 8 bits the output of a S-box is computed (’looked up in the
S table’).
4. Output Concatenation: All four pieces are concatenated together to form 32 bits.
5. Permutation: 32 bits are permuted using permutation P.
S is a substitution box transformation (Rijndael S-box):
The table of the S-box, stated in hexadecimal for compactness. Permutation P is given by
the table:
See the last page if clarification about S and P is needed.
5
1.2 Computing subkeys
The round keys of 32 bits (subkeys ki) are derived from the input key of 56 bits by means
of the key schedule (total of 10 subkeys) using the following schedule:
1. Splitting: The main key k of 56 bits is divided into two halves of 28 bits. Let’s denote
these halves as C0 and D0.
2. Transformation Function: In each round, a left shift by 1 function LS1 is applied
separately to both half’s of the data, typically the right half Ri
, using the round key
ki of 32 bits. The result of the function is then XORed with the other half Li
.
Ci+1 = LS1(Ci)
Di+1 = LS1(Di)
3. Concatenation: In each round two halves (Ci and Di) are concatenated together.
The first (left most) 32 bits forms the round subkey ki
.
4. Iteration: Steps 2 and 3 are repeated 10 times.
6
1.3 Required methods
Your implementation must include the following methods:
• Custom xorIt(binary1, binary2)
• Custom shiftIt(binaryInput)
• Custom permuteIt(binaryInput)
• Custom SubstitutionS(binaryInput)
• functionF(rightHalf, subkey)
• encryptBlock(block, inputKey),
• decryptBlock(block, inputKey),
• encryption(longBinaryInput, inputKey),
• decryption(longBinaryInput, inputKey),
• keyScheduleTransform(inputKey),
• runTests()
• You can have additional helper functions. Custom means you can NOT use
ready methods and must write your own methods.
1.4 Build-in tests
The runTests() mathod shall be invoked when user runs the program and it shall print
output for the following test cases:
• encryptBloc(all ones, all ones)
• encryptBloc(all zeros, all ones)
• encryptBloc(all zeros, zeros)
• encryptBloc(block,input key), where:
block = 1100110010000000000001110101111100010001100101111010001001001100
input key = all zeros
• decryptBlock(all ones, all ones)
• decryptBlock(all zeros, all ones)
7
• decryptBlock(all zeros, zeros)
• decryptBlock(block,input key), where:
block = 0101011010001110111001000111100001001110010001100110000011110101
input key = all ones
• decryptBlock(block,input key), where:
block = 0011000101110111011100100101001001001101011010100110011111010111
input key = all zeros
When running the program
When the user runs the program, it should print output for the test cases from section 1.4.
The program should then prompt the user to choose whether they want to encrypt or decrypt
and specify the filename to process. Additionally, the program should ask for a filename to
save the output, and an appropriate file should be created for this purpose.
Running Tests:
Output for: encryption(all ones, all ones)
0101011010001110111001000111100001001110010001100110000011110101
Output for: encryption(all zeros, all ones)
1100111010001000100011011010110110110010100101011001100000101000
Output for: encryption(all zeros, all zeros)
1010100101110001000110111000011110110001101110011001111100001010
Output for: encryption(block,all zeros), where:
block = 1100110010000000000001110101111100010001100101111010001001001100
0010101110011011010001010111000010110110101011111010000101100101
Output for: decryption(all ones, all ones)
0100111001000110011000001111010101010110100011101110010001111000
Output for: decryption(all zeros, all ones)
1011001010010101100110000010100011001110100010001000110110101101
Output for: decryption(all zeros, all zeros)
1011000110111001100111110000101010101001011100010001101110000111
Output for: decryption(block,all ones), where:
block = 0101011010001110111001000111100001001110010001100110000011110101
1111111111111111111111111111111111111111111111111111111111111111
Output for: decryption(block,all zeros), where:
block = 0011000101110111011100100101001001001101011010100110011111010111
1111111111111111111111111111111111111111111111111111111111111111
Do you want to encrypt or decrypt (E/D): E
Filename: data.txt
Secret key: 10101101011101110101010101011100010110101011100010101010
8
Output file: data1.txt
Submission Requirements
Zip (archive) all the project source files and a README file and save it as a Project1LastName.zip
file. Include your LastName (+partner) in the filename. Upload the file to the appropriate
folder on Gradescope. Your README file should include name of the members of the team
and any specific instruction which is useful for the project. It should also include all the features (including additional features) that you have implemented. Make sure all your source
files are properly commented so that user can browse your code without getting lost.
2 Grading
The rubric for this assignment is available through Gradescope. Your solution will be tested
with private test cases.
0 points if the program doesn’t compile. No points for the rest. Grading complete.
2.1 Important note about Academic Honesty
If some of the tasks are challenging or not for you, feel free to discuss with others but all
discussion have to be on high level without writing code or pseudocode. Once you sit down
and start coding, all the code you write should be your own . Using ready code from other
sources (internet, friends, chatGPT etc.) will be considered as a violation of the academic
honesty. After submitting your work, you should be able to explain your code in details, if
so requested by lab TAs or by the instructor. Your initial points may be reduced, if unable
to answer questions on your submitted work.
3 Hints
• Text file sbox.txt contains a constant - S- box look up table that you can use.
• S- box example:
– Let’s say we want to compute the substitution for the byte 53 (in binary 01010011).
– We’ll first convert 53 to its row and column indices.
– The first hex digit (5) represents the row index.
– The second hex digit (3) represents the column index.
– So, for 53, the row index is 5 and the column index is 3.
– Now, we’ll look up the value in the S-box using these indices.
9
– The value at row 5 and column 3 in the S-Box is ed (in binary 11101101).
• Permutation table example: Consider table (3x3):
Sample input: 101111000
Output after permutation: 001111010
– The permutation table rearranges the elements of the input according to the
specified positions.
– Each number in the permutation table represents the position of the corresponding
element in the input.
– For example, the element at position 1 of the input (value 1) becomes the element
at position 4 of the output.
– Similarly, the element at position 9 of the input (value 0) becomes the element at
position 1 of the output.
Sample input 2: 111000111
請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp

標簽:

掃一掃在手機打開當前頁
  • 上一篇:代寫MTRN4010、代做MATLAB程序設計
  • 下一篇:CS 213代做、Java設計編程代寫
  • 無相關信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區
    昆明西山國家級風景名勝區
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    爱情鸟第一论坛com高清免费_91免费精品国自产拍在线可以看_亚洲一区精品中文字幕_男人操心女人的视频
    <strike id="bfrlb"></strike><form id="bfrlb"><form id="bfrlb"><nobr id="bfrlb"></nobr></form></form>

        <sub id="bfrlb"><listing id="bfrlb"><menuitem id="bfrlb"></menuitem></listing></sub>

          <form id="bfrlb"></form>

            <form id="bfrlb"></form>

              <address id="bfrlb"></address>

              <address id="bfrlb"></address>
              欧美一区1区三区3区公司| 99re6这里只有精品视频在线观看| 久久久美女艺术照精彩视频福利播放| 国产嫩草影院久久久久| 国产欧美一区二区三区沐欲| 国产夜色精品一区二区av| 在线成人亚洲| 亚洲午夜视频在线| 亚洲精品一区二区三区樱花| aa日韩免费精品视频一| 国产伦精品一区二区三区在线观看| 欧美韩日高清| 欧美视频在线免费| 欧美日韩极品在线观看一区| 欧美一区二区在线看| 亚洲午夜精品一区二区三区他趣| 在线播放国产一区中文字幕剧情欧美| 美日韩精品免费| 国产亚洲制服色| 国产精品成人免费精品自在线观看| 午夜欧美大尺度福利影院在线看| 国产精品一区二区三区四区| 国产精品欧美日韩久久| 国产一级一区二区| 久久影院亚洲| 久久这里只有精品视频首页| 在线亚洲电影| 亚洲无毛电影| 伊人久久大香线蕉av超碰演员| 欧美亚洲一级片| 午夜精彩视频在线观看不卡| 亚洲高清在线精品| 国产午夜精品久久| 亚洲一区二区三区中文字幕在线| 亚洲电影在线免费观看| 欧美在线观看天堂一区二区三区| 一区二区av| 欧美成人免费全部观看天天性色| 国产在线乱码一区二区三区| 欧美男人的天堂| 狠狠入ady亚洲精品经典电影| 国产精品扒开腿爽爽爽视频| 美女精品视频一区| 亚洲一区在线直播| 亚洲区欧美区| 亚洲第一在线视频| 亚洲免费中文| 亚洲性线免费观看视频成熟| 美日韩精品免费观看视频| 欧美伊人精品成人久久综合97| 国产精品视频男人的天堂| 亚洲一区亚洲| 亚洲一区二区精品在线观看| 欧美日韩精品免费看| 欧美精品在线免费播放| 久热精品在线视频| 欧美一区观看| 最新亚洲视频| 国产亚洲欧洲| 亚洲精品乱码久久久久久按摩观| 欧美日产一区二区三区在线观看| 亚洲欧美国产一区二区三区| 欧美日韩国产二区| 欧美日韩精品在线视频| 欧美午夜寂寞影院| 国产女人18毛片水18精品| 午夜一区二区三区不卡视频| 欧美肥婆在线| 欧美激情视频一区二区三区免费| 亚洲国产精品国自产拍av秋霞| 亚洲第一区在线观看| 久久久久久**毛片大全| 蜜臀久久久99精品久久久久久| 国产曰批免费观看久久久| 国产九色精品成人porny| 欧美jizzhd精品欧美巨大免费| 韩国欧美一区| 欧美在线精品免播放器视频| 亚洲欧美制服另类日韩| 亚洲欧洲一区二区三区| 欧美在线一级视频| 亚洲视频自拍偷拍| 国产精品99久久久久久宅男| 亚洲午夜国产成人av电影男同| 午夜精品福利一区二区三区av| 国产午夜精品麻豆| 国产欧美欧美| 欧美性感一类影片在线播放| 亚洲欧美日本日韩| 欧美专区在线观看一区| 国产精品www色诱视频| 欧美精品免费视频| 日韩视频在线免费观看| 日韩视频在线免费观看| 欧美日韩亚洲天堂| 国产一区视频在线观看免费| 国产日本欧洲亚洲| 激情欧美一区二区三区| 亚洲二区视频| 久久精品99国产精品| 亚洲欧洲久久| 久久久久成人精品| 亚洲二区免费| 国产美女精品一区二区三区| 国产精品腿扒开做爽爽爽挤奶网站| 国产精品亚洲欧美| 黑人一区二区| 噜噜噜久久亚洲精品国产品小说| 老司机免费视频一区二区三区| 免费美女久久99| 欧美日本在线观看| 亚洲视频每日更新| 日韩视频专区| 夜夜夜精品看看| 在线观看亚洲| 亚洲国产精品女人久久久| 国产精品黄页免费高清在线观看| 久久精品日韩一区二区三区| 美女主播视频一区| 裸体女人亚洲精品一区| 永久域名在线精品| 欧美+亚洲+精品+三区| 欧美激情一区二区三级高清视频| 在线观看日韩| 一区二区日韩精品| 久久久精彩视频| 9久re热视频在线精品| 国产精品一区二区久久国产| 一本色道婷婷久久欧美| 亚洲欧美日韩网| 久久久久一区二区三区| 伊人色综合久久天天五月婷| 欧美电影免费观看高清完整版| 美国成人直播| 国产精品日日做人人爱| 在线一区二区三区做爰视频网站| 欧美激情精品久久久久久久变态| 亚洲黄色成人久久久| 久久国产日韩欧美| 亚洲深爱激情| 国产精品久久久久久久第一福利| 韩日成人av| 亚洲制服av| 久久精视频免费在线久久完整在线看| 激情综合网激情| 麻豆成人小视频| 欧美三级在线视频| 久久久最新网址| 国产精品久久久久久超碰| 国产精品海角社区在线观看| 欧美寡妇偷汉性猛交| 国产香蕉久久精品综合网| 久久伊人一区二区| 国产精品福利在线观看| 久久女同精品一区二区| 欧美成人黄色小视频| 亚洲一区二区黄色| 久久综合电影一区| 久久久福利视频| **网站欧美大片在线观看| 亚洲一区二区在线免费观看| 牛夜精品久久久久久久99黑人| 国产精品一区亚洲| 欧美韩日一区二区三区| 欧美专区日韩视频| 午夜精品在线| 久久手机免费观看| 欧美日韩成人在线视频| 国产欧美精品在线观看| 一本色道久久综合亚洲精品不| 久久男人av资源网站| 亚洲日本欧美| 韩国av一区二区三区四区| 久久精品国产久精国产思思| 中文久久精品| 欧美午夜女人视频在线| 亚洲视频高清| 欧美日韩国产a| 国产一区二区三区精品欧美日韩一区二区三区| 国产日本亚洲高清| 亚洲欧洲日产国产综合网| 美女视频一区免费观看| 欧美国产一区二区| 久久国产99| 亚洲精品欧美激情| 亚洲欧美日韩视频二区| 亚洲激情另类| 欧美一级艳片视频免费观看| 午夜精品久久久久久久| 欧美粗暴jizz性欧美20| 亚洲欧洲中文日韩久久av乱码| 午夜电影亚洲| 国产精品国产三级国产aⅴ无密码| 美女主播视频一区| 欧美jjzz| 校园激情久久| 午夜精品久久久久久久99热浪潮| 亚洲欧美日韩国产一区二区三区| 欧美精品一区二区精品网| 夜夜躁日日躁狠狠久久88av|