XOR 加密

 

 

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define KEY 0x86
int main()
{
   char p_data[16] = {"20183125уер╒"};
   char Encrypt[16]={0},Decode[16]={0};
   int i;
   for(i = 0; i < strlen(p_data); i++)
   {
   Encrypt[i] = p_data[i] ^ KEY;
   }
   for(i = 0; i < strlen(Encrypt); i++)
   {
   Decode[i] = Encrypt[i] ^ KEY;
   }

   printf("Initial date:  %s\n",p_data);
   printf("Encrypt date:  %s\n",Encrypt);
   printf("Decode date:  %s\n",Decode);

   return 0;

}

 

posted @ 2023-02-17 06:23  20183125张尧  阅读(46)  评论(0)    收藏  举报