I thought it would be a fun little project to create a tripcode finder in C, but I realized I don't know how a tripcode is generated from the given input text. I know secure tripcodes use an unknown salt, but non-secure tripcodes don't, so i was hoping someone here could explain how tripcodes on 4chan get generated.
Basically it gets generated by a fucking faggot.
>>60184152
Read wakaba manuals.
Here's a simple implementation I wrote for my chan clone.char *tripcode_hash(const char *pass)
{
/* returns pointer to static data -- NOT THREAD SAFE */
if (!pass) return NULL;
static const char *secret = "H.";
const char *p = (strlen(pass) < 3) ? NULL : pass; /* too short? */
char salt[5]; /* create salt */
sprintf(salt, "%c%c%s", (!p) ? ' ' : p[1], (!p) ? ' ' : p[2], secret);
char *s = salt;
do /* sanitize salt */
{
if (*s < '.' || *s > 'z') /* clamp to './0-9A-Za-z' */
*s = '.';
else if (*s >= ':' && *s <= '@') /* if ':;<=>?@' */
*s += 6; /* shift to 'ABCDEF' */
else if (*s >= '[' && *s <= '`') /* if '[\]^_`' */
*s += 6; /* shift to 'abcdef' */
} while (*++s);
char *trip = crypt(pass, salt);
memmove(&trip[1], &trip[3], strlen(&trip[3]) + 1);
trip[0] = '!';
return trip;
}
>>60184182
Where can i find these? Google just turns up a bunch of unintelligible asian scribbles.
>>60184226
Yep, guess where *chans originated
https://github.com/ctrlcctrlv/infinity/blob/f89ac3f3090ca2025190a006abdfaf448e6110db/inc/functions.php
See the function generate_tripcode
It's a combination of Shift JIS encoding and the crypt function.
>>60184240
Yeah, but I was hoping for english language support. Up until recently m00t was an american, so i was hoping for english.
>>60184215
This is really useful! Thanks!