所以我想知道如何解密通过命令行参数使用ASCII和未知密钥打开的加密文本文件,然后将其全部打印出来并使用答案密钥。我似乎已经能够实际打印出加密的消息,但不知道如何确定如何找到密钥并将其打印出来。
int main( int argc, char *argv[]) {
FILE *fp = stdin; // defaults
int n = 13;
int shift;
// process command line
switch (argc) {
default:
fp = fopen(argv[1], "r"); // should check for problems
n = atoi(argv[2]);
break;
}
// rotate text
int c, key;
int i;
while( (c = fgetc(fp)) != EOF) {
// This is where I have managed to make C an integer
// and print out the encrypted message using the printf function.