summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cst120/week_4/homework_4.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/cst120/week_4/homework_4.c b/cst120/week_4/homework_4.c
index be274d8..03028bf 100644
--- a/cst120/week_4/homework_4.c
+++ b/cst120/week_4/homework_4.c
@@ -30,6 +30,7 @@ int main(void) {
do {
char *caesar_cipher_encrypted_message = NULL;
char *rail_fence_encrypted_message = NULL;
+ char *caesar_rail_fence_encrypted_message = NULL;
/* Prompt and accept cipher message */
printf("Enter a message: ");
@@ -43,11 +44,15 @@ int main(void) {
*/
caesar_cipher_encrypted_message =
caesar_cipher_encrypt(user_message, &user_key);
- rail_fence_encrypted_message =
+ rail_fence_encrypted_message = rail_fence_encrypt(user_message);
+ caesar_rail_fence_encrypted_message =
rail_fence_encrypt(caesar_cipher_encrypted_message);
/* Output final double-cipher-ed result */
- printf("%s\n", caesar_cipher_encrypted_message);
+ printf("Caesar cipher: %s\n", caesar_cipher_encrypted_message);
+ printf("Rail Fence cipher: %s\n", rail_fence_encrypted_message);
+ printf("Rail Fence + Caesar cipher: %s\n",
+ caesar_rail_fence_encrypted_message);
/* Prompt user to repeat */
printf("Would you like to go again? (y/n) ");