Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete the following function void shape_keystream() in C void get_128_keystream_bits(char* ct,char* kpt){ FILE* ct_f = fopen(ct,r); FILE* fp = fopen(key_stream.txt,w); int i = 0; for(;i

Complete the following function void shape_keystream() in C

void get_128_keystream_bits(char* ct,char* kpt){

FILE* ct_f = fopen(ct,"r"); FILE* fp = fopen("key_stream.txt","w"); int i = 0; for(;i<16;i++) { unsigned char ctc = getc(ct_f); unsigned char b = ctc^kpt[i]; //fprintf(stderr,"%d ",b); int j = 7; for(;j>=0;j--){ int bit = parity(b & (1<

}

>>>>>> void shape_keystream() { /* This function opens the file "key_stream.txt" created by get_128_keystream_bits(). It uses this data to create a file called "S.mat.sage" which is a 64x64 ix of keystream bits of the form discussed in the project description. It also creates a vector (a 64x1 matrix) of keystream bits of the form described in the project description. This is stored in a file called "V.mat.sage" */

//See the file matrix.sagews for examples of what the output should look like.

/*You implement this*/

}

<<<<<<<<<<

int main() { LFSR L; uint64_t initial_state = 0xbeefcafebabecab1; uint64_t taps = 0xdeaddeedacedface; init_LFSR(&L,initial_state,taps); encrypt("toy_pt.txt","ct.txt",&L); init_LFSR(&L,initial_state,taps); decrypt("ct.txt","toy_ot.txt",&L); //get_128_keystream_bits("target_ciphertext",""); //shape_keystream(); }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions