Last active
July 1, 2020 14:46
-
-
Save harieamjari/5b04b4b0d81ac90fb59d2bf6d6a1498f to your computer and use it in GitHub Desktop.
From facebook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int | |
main(){ | |
char tobe_encrypted[8]; | |
printf("enter pin: "); | |
scanf("%s", tobe_encrypted); | |
char tmp; | |
char processed9[8]; | |
for (int i = 0; i < 8; i++){ | |
processed9[i] = | |
(char) (((9+(int)tobe_encrypted[i]-48)%10)+48); | |
} | |
printf("%s\n", processed9); | |
// swap first and fifth | |
tmp = processed9[0]; | |
processed9[0] = processed9[4]; | |
processed9[4] = tmp; | |
//swap second with sixth | |
tmp = processed9[1]; | |
processed9[1] = processed9[5]; | |
processed9[5] = tmp; | |
//swap third and seventh | |
tmp = processed9[2]; | |
processed9[2] = processed9[6]; | |
processed9[6] = tmp; | |
// fourth and eight | |
tmp = processed9[3]; | |
processed9[3] = processed9[7]; | |
processed9[7] = tmp; | |
printf("%.8s\n", processed9); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment