Exemplo n.º 1
1
void vigenere_decode(char* dst, char* src, char* pass) {
    vigenere(dst, src, pass, 0);
}
Exemplo n.º 2
0
int main(int argc, string argv[])
{
    if (argc != 2) {
        printf("oops! \n");
        return 1;
    }
    string key = argv[1];
    for (int n = 0; n < strlen(key); n++)
    {
        if ((key[n] >= '0') && (key[n] <= '9'))
        {
            printf("Sorry! Your key containt the number\n");
            return 1;
        }
    }
    string str=GetString();
    int j=0;
    for (int i = 0; i < strlen(str); i++) 
    {
        if(j>=strlen(key))
        {
            j=0;
        }
        printf("%c",vigenere(str[i],key[j]));
        if(isalpha(str[i]))
        {
            j++;
        }    
    }
    printf("\n");
}
Exemplo n.º 3
0
void vigenere_encode(char* dst, char* src, char* pass) {
    vigenere(dst, src, pass, 1);
}