EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
C语言代写
您的位置: 主页 > 编程案例 > C语言代写 >
代写C语言:C Assembly代写 | C语言汇编代写 | 硬件编程代写 - C语言代写
发布时间:2021-07-25 20:03:12浏览次数:
Extra Credit: 2 points View Extra Credit section for moreWrong Language: You will lose 10 points for each module in the wrong language, C vs. Assemblyor viceNOTE: If what you turn in does not compile with given Makefile, you will receive 0 points for this assignment.Follow these steps to acquire the starter files and prepare your Git repository.Gathering Starter Files:The first step is to gather all the appropriate files for this assignment. Connect to pi-cluster via ssh.$ ssh [email protected]Create and enter the pa2 working directory.$ mkdir ~/pa2$ cd ~/pa2Copy the starter files from the public directory.$ cp ~/../public/pa2StarterFiles/* ~/pa2/Copy your isInBounds files from your pa1 directory.$ cp ~/pa1/isInBounds.s ~/pa2/$ cp ~/pa1/testisInBounds.c ~/pa2/Preparing Git Repository:You are required to use Git with this and all future programming assignments. Refer to the PA0 writeup for how to set up your local git repository.The usage for the PA2 cipher program:Usage: ./pa2 passphrase key0 key1 rotateValuepassphrase (must have length within the range [4, 8])key0 (must be numeric; decimal, octal, or hexadecimal) key1 (must be numeric; decimal, octal, or hexadecimal) rotateValue (must be a decimal value within the range [+0, +63])The passphrase is a string whose bytes will be XORed with the bytes of integers key0 and key1. This generates an 8-byte/64-bit mask which will generate a pad used to encrypt a message. We generate the pad by rotating the mask by rotateValue bits for every 8 bytes of the input message. The message is read from stdin (user keyboard input or redirected file).Example of encryption/decryptionLet s encrypt something! We will run the executable with:passphrase =cse30key0 =0xABCDkey1 =0x1234rotateValue =8which looks like this:[email protected]:pa2$ ./pa2 cse30 0xABCD 0x1234 8If run it like this, the executable will appear to stall / loop infinitely. This is because it is waiting for user input to encrypt. We can type in some message we want to encrypt, press enter and Ctrl+D twice (^D) to indicate we are done typing (user inputted text is bolded):[email protected]:pa2$ ./pa2 cse30 0xABCD 0x1234 8meet me in B420 at 20 past 4^DS��@%CA��@QCUqWy^D[email protected]:pa2$As you can see, we get a random-looking piece of output in return. This is the encrypted message. Though typing directly is an option to encrypt using PA2 cipher, it s obviously very messy and difficult to use. Below are some ways to streamline the encryption/decryption process.Assume we have a file called input, which contains the following text: File inputThe following command will encrypt the input file and print it out to stdout (terminal screen): [email protected]:pa2$ ./pa2 cse30 0xABCD 0x1234 8 input S��@%CA��@QCUqWyAs you can see, the output is still messy and unreadable. On top of this, it is not very easy to copy/paste this output and send it to your desired recipient. What would be better is to capture the output in a file called output:[email protected]:pa2$ ./pa2 cse30 0xABCD 0x1234 8 input outputNotice the use of the bash redirection operators  and . Since the input to the executable is read from stdin, we use the  operator to redirect the file input to the stdin file. This makes the contents of input available to the program as if someone were typing directly to stdin. The operator takes output on stdout and redirects it into a file in this case we chose the name output .Once your recipient gets your message in some way (e.g. you send them the output file), they can decrypt your message as long as they know the same passphrase, keys, and rotateValue:[email protected]:pa2$ ./pa2 cse30 0xABCD 0x1234 8 output meet me in B420 at 20 past 4If someone intercepts your file, but doesn t know the passphrase, keys, or rotateValue, they won t be able to decrypt the file:[email protected]:pa2$ ./pa2 idontkno 123 456 6 outputgrğd6+ ��0�ӭ��S��瘼�bNotice how the output file has become the input file on the decryption side.Viewing output filesAs noted above, the output of encryption is usually unreadable. However, it can be helpful in debugging to see what bytes (specifically, what byte values) are in the encrypted output. You can cross reference these values with the original message to make sure that the right byte values are coming out of the encryption. To do this, you should use the hexdump command line tool. For example, using hexdump on the output file from above looks like:[email protected]:pa2$ hexdump -C output

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。