X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=samples%2Fcrypt%2Fmain.c;fp=samples%2Fcrypt%2Fmain.c;h=773f0eaa4116842729ae384cfa942527ef221b9c;hp=0000000000000000000000000000000000000000;hb=379a273ffec1fefe8b6f9af3a959ae85eba17857;hpb=0ce5b46ac41f3ac806ee1828eb121dd196bf1251 diff --git a/samples/crypt/main.c b/samples/crypt/main.c new file mode 100644 index 0000000..773f0ea --- /dev/null +++ b/samples/crypt/main.c @@ -0,0 +1,21 @@ +#define _GNU_SOURCE +#include +#include +#include + +int check(char * str) { + /* Ich bin der größte! */ + static const char * correct = "TOgP5hrln1SAE"; + printf("%s\n", crypt(str, "TOPSECRET")); + return ! strcmp(correct, crypt(str, "TOPSECRET")); +} + +int main() { + char password[255]; + printf("Password: "); + scanf("%s", password); + if (check(password)) + printf("Success!\n"); + else + printf("Failure!\n"); +}