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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started