예제 #1
0
int encrypti(int argc, char **argv)
{
    char **idarray;
    int i;
    int count;

    if (argc < 2) {
	printf("Usage: encrypt ID [ID ...]\n\n");
	printf("Encrypts stdin for given ID(s) and prints on stdout\n");
	return 1;
    }

    count = argc - 1;
    idarray = (char **) alloca(sizeof(char *) * count);

    for (i=0; i<count; i++) {
	idarray[i] = FMT_make_id(argv[i + 1], NULL, params);
    }

    FMT_encrypt_stream_array(idarray, count, stdin, stdout, params);

    for (i=0; i<count; i++) {
    //printf("%s\n",idarray[0] );
	free(idarray[i]);
    }
    return 0;
}
예제 #2
0
파일: format.c 프로젝트: argp/ibe-win32
void FMT_encrypt_stream(char *id, FILE *infp, FILE *outfp, params_t params)
{
    FMT_encrypt_stream_array(&id, 1, infp, outfp, params);
}