lano
Aktives Mitglied
Moin.
Ich bekomm das mal wieder nicht gebacken.
Eigentlich will ich nur TP-Link Smart Plug Protocol ver- und entschlüsseln.
Ich traus mich gar nicht zu posten...
Das mein erster Versuch und ich hab jetzt schon die Schnautze voll...
Könnt mir das noch mal einer erklären? Für doofe wie mich...
Ich bekomm das mal wieder nicht gebacken.
Eigentlich will ich nur TP-Link Smart Plug Protocol ver- und entschlüsseln.
Ich traus mich gar nicht zu posten...
tp-link.c:
/* tp-link */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int encryption(char b[], int size) {
int k = 171;
for (int i = 0; i < size; i++) {
int t = b[i] ^ k;
k = b[i];
b[i] = t;
printf("%s", b[i]);
}
printf("\n");
return 0;
}
int decryption(char b[], int size) {
int k = 171;
for (int i = 0; i < size; i++) {
b[i] = b[i] ^ k;
k = b[i];
printf("%s", b[i]);
}
printf("\n");
return 0;
}
int main(int argc, char *argv[], char *envp[]) {
Encryption(argv[1], strlen(argv[1]));
return EXIT_SUCCESS;
}
Das mein erster Versuch und ich hab jetzt schon die Schnautze voll...
Könnt mir das noch mal einer erklären? Für doofe wie mich...