Guest User

Untitled

a guest
Jan 16th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. FILE *openFile, *resultFile;
  2. char buffer[8], key[8] = "01234567";
  3. if ((openFile = fopen("c:/dev/encoding/test.xlsx", "rb")) == NULL) {
  4. printf("Cannot open file.n");
  5. exit(1);
  6. }
  7. if ((resultFile = fopen("c:/dev/encoding/test.enc", "wb")) == NULL) {
  8. printf("Cannot open file.n");
  9. exit(1);
  10. }
  11. fread(buffer, sizeof(char), 8, openFile);
  12. do {
  13. encrypt(buffer, key);
  14. if ((fwrite(buffer, sizeof(char), 8, resultFile)) != 8) {
  15. printf("Fatal Error writing output file!!!n");
  16. exit(-1);
  17. }
  18. fread(buffer, sizeof(char), 8, openFile);
  19. } while (!feof(openFile));
  20. fclose(openFile);
  21. fclose(resultFile);
Add Comment
Please, Sign In to add comment