How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Scott Your Own Question
Scott, MIT Graduate
Category: Homework
Satisfied Customers: 3040
Experience:  MIT Graduate (Math, Programming, Science, and Music)
Type Your Homework Question Here...
Scott is online now
A new question is answered every 9 seconds

I am looking to write a function to take in encrypted text

Customer Question

I am looking to write a function to take in encrypted text decrypt it and print out the text. Download link encrypted file:… Download link unencrypted file (what file should read as):… more
detail:… To decrypt the text, reverse the encryption steps. Requirements Read a text file to be encrypted/decrypted into your program Write a program to decrypt a file Write a program to encrypt a file Write the result of the
encryption/decryption process. Use bitwise operators to encrypt/decrypt the file Use a typedef in your program No global variables (global const and #define are ok) Here is what i have so far: /* Instructor provided (hint) Byte byte = 0b01101010; Byte mask1
= 0b11110000; Byte first4 = byte & mask1; //0b01100000 Byte mask2 = 0b00001111; Byte las 4 = byte & mask2; //0b00001010 Byte newfirst = last4<<4; //0b10100000 Byte newlast = first4>>4; //0b00000110 Byte newbyte = newfirst | newlast; //0b10100110 */ #include
#include void decrypt () { } int main() { FILE *fpr; /*Char array to store strings */ char str[100]; /*Opening the file in "r" mode*/ fpr = fopen("/Users/ACR/documents/school/c/Lab3/hamlet_encrypt.txt","r"); /*Error handling for file open*/ if (fpr == NULL)
{ puts("Issue in opening the input file"); exit(1); } decrypt(fpr); /*Loop for reading the file till end*/ while(1) { if(fgets(str, 10, fpr) == NULL) break; else printf("%s", str); } /*Closing the input file after reading*/ fclose(fpr); return 0; }
Submitted: 2 years ago.
Category: Homework
Expert:  ATLProg replied 2 years ago.
hello by when you need this done?