Question: C PROGRAMMING Implement a function (using only #include library) that can encrypt/decrypt with a substitution cipher. cipher_sub (a, b, c, d) a is the string

C PROGRAMMING

Implement a function (using only #include library) that can encrypt/decrypt with a substitution cipher.

cipher_sub (a, b, c, d)

a is the string that has the data that will be encrypted or decrypted

b is the string that has the result of the encrypt/decrypt

c is the code string used for our substitution cipher (27 entries plus '\0' character)

d is an integer that will pass two constants defined as ENC (encrypt) or DEC (decrypt)

--> The function is supposed to return the character that is in the shifted array at the index (aka what is the character at index z)

**The length of the code is unknown (but can be figured out using '\0' character)

**Assume that strings of 27 (26 letters in the alphabet and the space "_") characters can be called, and that all the characters are unique (never repeated).

PLEASE COMMENT ON YOUR CODE EXPLAINING WHAT WAS DONE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!