woody-woodpacker/srcs/encrypt.c

15 lines
406 B
C
Raw Normal View History

2024-02-21 12:54:33 +00:00
#include "../includes/woody.h"
void encrypt(char *file, unsigned long int offset, unsigned long int size)
{
size_t i = 0;
while (i < size)
{
2024-04-17 10:14:08 +00:00
file[offset + i] = file[offset + i] - 1;
2024-02-21 12:54:33 +00:00
++i;
}
printf("\nENCRYPTION : \n");
printf(" File encrypted from %ld (%lx) to %ld (%lx)\n", offset, offset, offset + size, offset + size);
printf(" Size of encryption = %ld (%lx)\n", size, size);
printf("\n");
2024-02-21 12:54:33 +00:00
}