atakoute_CS3626_Assignment04

docx

School

Kennesaw State University *

*We aren’t endorsed by this school

Course

3626

Subject

Computer Science

Date

Apr 3, 2024

Type

docx

Pages

9

Uploaded by PresidentMooseMaster1069

Report
- 1 - CS3626 Homework 04 Spring 2024 AES Total Points: 25 Be as brief as possible and use your own words when describing concepts.   SHOW ALL WORK for Questions requiring calculations and algorithms. Q-1: Calculate the following polynomial operations over a m(x), GF(2^x) where a i GF(2) given m(x) Given these polynomials where: A = x 7 + x 6 + 0 + x 4 + 0 + x 2 + 0 + x 0 B = x 6 + x 5 + 0 + 0 + 0 + 0 + x 0 m(x) = x 8 + 0 + 0 + 0 + x 4 + x 3 + 0 + x 1 + x 0 a i operations are modulo-2 math. Calculate the operations below; show the setup and operation steps and result, remember they are over m(x):
- 2 - A mod B 2*A + 3*B + (A* B) + (A+B) = // recall the shortcut of 3*A = A + 2*A = A + (A << 1) over m(x) // you already have A*B and A+B from above
- 3 - Use Extended Euclidean on the pair ( m(x), A) to find the modular inverse A -1 . 5 points
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
- 4 - Q-2: Build the 4x4 State box from the following 128-bit plain text input: Input = 4e 6f 20 6d 6f 72 65 20 73 65 63 72 65 74 73 2e 1 point Q-3: Take the above state box convert the state box values by applying each byte to the AES-SBOX. What is the new state box result?
- 5 - 2 points Q-4: What is the new state box result of applying the AES shift Columns function to the state box above: 2 points Q-5: Given the above state box, calculate the Mix Columns result of ONLY s’ 1,1 Recall:
- 6 - Show all calculation steps (XOR operations and multiplication/shifts) S’ 1,1 = 0x04 4 points
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
- 7 - Q-6: Implement the following polynomial operation in a language (C++, C#, Python, Java): (i) Get Polynomial Degree Write a function to find the highest degree of a given polynomial: e.g. if given x 13 + x 7 + x 4 + x 1 + x 0 the function get_degree( a(x)) will return 13. A pseudocode algorithm: // returns highest exponent value of shortcut representation of a polynomial // returns -1 if a(x) == 0 get_degree( unsigned int a(x)) { int degree = -1; if( a(x) == 0) { return(degree); } while( a(x) != 0) { ++degree; // keep incrementing while there are 1’s in number a(x) = a(x) >> 1; // divide by 2 which shifts out lowest bit value } return( degree); } (ii) Polynomial Modulus over GF with m(x) Write a function to long divide two polynomials, i.e. (A(x), m(x)). Use the binary shortcut to indicate the values of A(x) = a n *x n + a n-1 *x n-1 +… a 5 *x 5 + a 4 x 4 + a 3 x 3 + a 2 x 2 + a 1 x 1 + a 0 x 0 becomes the binary number a n a n-1 … a 5 a 4 a 3 a 2 a 1 a 0 and perform the respective bitwise operations. This makes m(x) = 0x11B in hexadecimal for example. The function use modulo 2 math. A possible algorithm: Unsigned int divide_galois( A(x), m(x)) { result = A(x); while (get_degree(result) >= get_degree(m(x)) { result = result XOR ( get_degree(result) - get_degree(m(x))); } return( result); } unsigned int A(x) = multiplicand unsigned int B(x) = multiplier unsigned int m(x) = modulus = x 8 + 0 + 0 + 0 + x 4 + x 3 + 0 + x 1 + x 0 = 0x11B unsigned int multiply_galois( A(x), B(x), m(x)) { int index = 0; int result = 0;
- 8 - while( B(x) != 0) { // run until no bits left in multiplier If ( b 0 == 1) { // Test the lowest bit of b(x) result = result XOR (A(x) << index)) // index is the current degree of the multiplicand } B(x) = B(x) >> 1 // SHIFT out the current b 0 and bring new b 0 ++index; // raise the degree of the multiplicand for next loop in the line above } return( divide_galois( result, m(x)); } Using the above calculate the following and provide the results here: get_degree( 0x3CF0) = 13 get_degree( 0x10000) = 16 get_degree( 0x00) = -1 get_degree( 0x01) = 0 divide_galois( 0x1000, 0x11B) = 0xAB divide_galois( 0xE1, 0x11B) = 0xE1 divide_galois( 0x32CFE1, 0x11B) = 0xD3 divide_galois( 0xE1, 0x11B) = 0xE1 multiply_galois( 0xD5, 0x61, 0x11B) = 0xE1 multiply_galois( 0x1E3C, 0x1E3C, 0x11B) = 0xA (i) 3 points (ii) 4 points (iii) 4 points Keep source code, it will be needed for future exercises. AES KEYGEN and DECRYPTION will be in Next Assignment
- 9 - Submission Guidelines: No handwritten submission is accepted, always submit answers as text within this or similar document file with any support images embedded in the file. EXCEPTION : If asked for source code implementation you can submit those individually and as separate files in ASCII format in their original file format .cpp, .java, .py, .cs etc. or even as a .txt file will be acceptable. Do not insert code into the submission document file. It ruins spacing which makes .python and some languages (perl, awk etc.) difficult to test build. Do not submit ZIP files… ever… for anything in D2L. The system is extremely unhelpful with regards to those filetypes and grading. You may include your freehand drawing/image and handwritten scans in the submission. However, the writing and images must be clearly legible. Though, it is best to present non-handwritten submissions, generally, as is done in the professional setting. If asked, show all work/calculations/graphs etc. in the determination of the problem. Please complete your entire work in a single Word Document and Save the file as: yournetid_CS3626_Assignment04.docx (e.g. ogarcia5_CS3502_Assignment01.docx.) and upload your file in D2L. Please observe the submission due date and time. After the due date there is a 50% penalty for the next 24 hours. Any submission after 24 hours of the due date will be graded at 0%. If you include a reference or an image taken from other sources, please cite them appropriately. APA is preferred but cite them so they can be found. NOTE: verbatim copying or even paraphrasing is plagiarism so if the source used constitutes your answer rather than simply supporting the answer, it will be considered invalid. This is especially true of source code implementation answers. If you resubmit, please make sure to attach the file again. Your latest submission before the due date will be the one graded.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help