i want to make rot13 encryption
this program convert ascii code from a caracter, and work only with uppercase character (65-90)
please help me
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void rot13(const char *input);
int main(void) {
char *input;
printf("Enter string (max. 255 characters) : ");
gets(input);
printf("\nConvert result %s to ROT13 = ", input);
rot13(input);
return 0;
}
void rot13(const char *input) {
int tmp[255], i;
for (i=0;i<strlen(input);i++) {
if ((int)input[i] < 65 || (int)input[i] > 90) {
printf("not valid\n");
exit(1);
}
}
for (i=0;i<strlen(input);i++) {
tmp[i] = ((int)input[i])+13;
}
printf("%i", tmp);
}