Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

.e) Steganography deals with successive mathematical operations on prime number

ID: 3738644 • Letter: #

Question

.e) Steganography deals with successive mathematical operations on prime number based data elements for data encrypton lyes, no, does not matter], why? e Ans ..Reason Question 4] Consider ASCII code for the data security functional C program. All variables and needed headers are properly declared. char s[ 64 ]: unsigned *ptr1 s size_t ij.k puts("Enter a line of text: laln") fgetsl s, 64, stdin ) puts( "Inla convert to proper case"); for ( i = 0; s[1]|s102++i ) printf ("%c: %d It",tolower (s[ i ] . (i. 2)), tolower(s[i ] . (i.2))); .a) How many bytes and how many bits long is the s array in the above .a) s array in bytes-- in bits- .b) the ptr1 hex address is given as 0028FE70. What is the decimal equivalent value for ptr1? .b) ptr1 decimal value .c) Does the s array pointer value move towards lower value or higher value as the data is entered? lower value, higher value, does not matter]; Why? c) Ans-.R Reason - d) Character string DFGHJ entered for fgets(s, 64, stdin); What are the characters printed with the for' loop? d) Ans .e) What is the final value of i' variable when the for loop terminates? .e final '' value

Explanation / Answer

a)

let char is 1byte

s holds 64 chars so it takes 64*1 = 64 bytes

64 bytes = 64 * 8 bits

so s takes

64bytes, 512 bits

b)

Hext address of ptr1 = 0028FE70

Start at the rightmost digit. Convert that digit to decimal and multiply with 160 (20 = 1). Convert second digit to decimal and multiply with 161, third digit multiply with 162...

In this example we have:

Step 2:

Add together all products

0 + 112 + 3584 + 61440 + 524288 + 2097152 = 2686576

(0028FE70)16 = 2686576

decimal value = 2686576

D)   

toLower(D - 2*0) = toLower(D-0) = toLower(D) = d = 100

toLower(F - 2*1) = toLower(F-2) = toLower(D) = d = 100

toLower(G - 2*2) = toLower(F-4) = toLower(C) = c = 99

toLower(H - 2*3) = toLower(H-6) = toLower(B) = b = 98

toLower(I - 2*4) = toLower(I-8) = toLower(A) = a = 97

ans

d 100   d 100   c 99    b 98    a 97

E)
Loop terminates when we reach end of the array

which it stops when i is equals to length of array

i = strlen(s)

a)

let char is 1byte

s holds 64 chars so it takes 64*1 = 64 bytes

64 bytes = 64 * 8 bits

so s takes

64bytes, 512 bits

b)

Hext address of ptr1 = 0028FE70

Start at the rightmost digit. Convert that digit to decimal and multiply with 160 (20 = 1). Convert second digit to decimal and multiply with 161, third digit multiply with 162...

In this example we have:

HEX DIGIT DEC VALUE MULTIPLICATION RESULT 0 0 0 * 160 0 7 7 7 * 161 112 E 14 14 * 162 3584 F 15 15 * 163 61440 8 8 8 * 164 524288 2 2 2 * 165 2097152

Step 2:

Add together all products

0 + 112 + 3584 + 61440 + 524288 + 2097152 = 2686576

(0028FE70)16 = 2686576

decimal value = 2686576

D)   

toLower(D - 2*0) = toLower(D-0) = toLower(D) = d = 100

toLower(F - 2*1) = toLower(F-2) = toLower(D) = d = 100

toLower(G - 2*2) = toLower(F-4) = toLower(C) = c = 99

toLower(H - 2*3) = toLower(H-6) = toLower(B) = b = 98

toLower(I - 2*4) = toLower(I-8) = toLower(A) = a = 97

ans

d 100   d 100   c 99    b 98    a 97

E)
Loop terminates when we reach end of the array

which it stops when i is equals to length of array

i = strlen(s)