//extern int dencrypt(char *password, char *ciphertext, char *plaintext); //extern int encrypt(char *password, char *plaintext, char *ciphertext); int main() { char password[20]={"user password"}; char plaintext[100]={"www.cms.hit.edu.cn"}; char ciphertext[100]={""}; encrypt(password,plaintext,ciphertext); printf("%s\n",ciphertext); dencrypt(password,ciphertext,plaintext); printf("%s\n",plaintext); return 0; }
int main(int argc, char **argv) { char ch[80]; *argv++; if (argc != 3) { printf("Paramer is right!\n"); exit(0); } else if (strcmp(*argv, "e") == 0) { encrypt(*argv, ch); printf("%s\n", ch); } else if (strcmp(*argv, "d") == 0) { dencrypt(*argv, ch); printf("%s\n", ch); } else { printf("The paramer is not right!\n"); exit(0); } return 0; }