Would someone be able to help with this please? Need a Assembly language program
ID: 3843162 • Letter: W
Question
Would someone be able to help with this please?
Need a Assembly language program to be compiled with Tasm on Dosbox. The program is one that should read in a file given to it by the user print its contents to the screen, encrypt the file and print the encrypted message to the screen and finally decrypt the encrypted messgae and print the original contents of the file to the screen.
The encryption will be using Adobe type 1 font encryption algorithm (encryption method explained on pages 61 to 65 on the pdf file https://www-cdf.fnal.gov/offline/PostScript/T1_SPEC.PDF ).
Comments throughout the program would be appreciated.
Explanation / Answer
#include <stdio.h>
#include <conio.h>
#include<string.h>
void printwords(const char *);
main()
{
FILE *fp;
char filename[20];
printf("Enter a file to print: ");
scanf("%s",&filename);
printwords(filename);
getch();
}
void printwords(const char *filename)
{
FILE *fp;
int n = 0;
char word[20];
if((fp = fopen(filename, "r")) != NULL)
{while( fscanf(fp,"%s",word)!=EOF)
printf("%s ",word);
}
fclose(fp);
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.