I've been tinkering with Python all day today... it's pretty slick. Just for practice, I tried to cobble together a tripcode decoder that would let you have "real" words in your tripcode as !WAHa and Sling and others do, and it actually came out better than I thought it would be. I'm aware there's already a program that does this, but if memory serves me, it's Windows-only and in Japanese besides. My script is kind of dumb in the way it goes about things -- it basically just tears through random strings until it finds one that fits -- but I've tested it repeatedly and it seems to work. If you'd like to check it out, nab it here:
http://www.anre.org/crap/detripper.bz2
Of course, you may need to modify the hashbang line depending on where Python is on your machine, and don't forget those execute bits, people... Use "-h" for help.
First person to ask how to get this to run on Windows gets pointed and laughed at.
>>265
So I've found one I liked, but it uses a "ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ�ÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ�". However I'm too dumb to actually understand how to find it in that list. /r/ help
>>300
That's already a Shift-JIS character. Since only the lower seven bits matter, you can usually find the ASCII character it matches with the high bit removed, but unfortunately for you ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ�ÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ� corresponds to " (a quotation mark) -- and quotes get mangled in tripcodes.
At least for Wakaba/Kareha based boards, you can just switch the page's charset to Shift-JIS before posting and it'll work.
No, Wakaba and Kareha both automatically convert tripcodes to Shift-JIS no matter what the charset. If you start changing it manually, you're more likely to break it than anything else.
>>302
http://4-ch.net/code/kareha.pl/1187656971/7,11
http://kei.iichan.net/sand/res/849.html [first three messages]
In both of those I left the encoding alone on the first post, and switched to SJIS afterward.
I also have three test installations of both Wakaba and Kareha on three separate systems, and none of them convert the character sets correctly.
http://kei.iichan.net/sand/res/976.html
So what am I doing wrong here? It's not matching with what it said it should change to. D:
I'm not sure what you're trying to do, but the test case works exactly as it should - #ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ�ÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ� becomes !yGAhoNiShI.
Do not test tripcodes in here. If you really have to, use the test thread.
Python-fag here, this seems to work fairly decently for ASCII tripcodes, seeing as Albright's original Python version is nowhere to be found, so it's based on the Thorn PHP version he posted earlier.
This code probably sucks and is slow.
def tripcode(trip):
if len(trip) > 0:
salt = trip[1:3] + "H.."
kill_non_ascii = re.compile("[^\.-z]")
salt = kill_non_ascii.sub('.', salt)
replace_dict = {
":" : "A",
";" : "B",
"<" : "C",
"=" : "D",
">" : "E",
"?" : "F",
"@" : "G",
"[" : "a",
"\\" : "b",
"]" : "c",
"^" : "d",
"_" : "e",
"`" : "f",
}
for line in replace_dict:
salt = salt.replace(line, replace_dict[line])
trip = trip.encode('shift_jis', 'replace')
salt = salt.encode('shift_jis', 'replace')
result = crypt(trip, salt)[3:]
else:
result = ""
return result
>>311
Ugh!
def get_tripcode(pw):
pw = pw.encode('sjis', 'ignore') \
.replace('"', '"') \
.replace("'", ''') \
.replace('<', '<') \
.replace('>', '>') \
.replace(',', ',')
salt = re.sub(r'[^\.-z]', '.', (pw + 'H..')[1:3])
salt = salt.translate(string.maketrans(r':;=?@[\]^_`', 'ABDFGabcdef'))
return crypt.crypt(pw, salt)[-10:]
import re,string,crypt
def get_tripcode(pw):
pw = pw.encode('sjis', 'ignore') \
.replace('"', '"') \
.replace("'", '\'') \
.replace('<', '<') \
.replace('>', '>') \
.replace(',', ',')
salt = re.sub(r'[^\.-z]', '.', (pw + 'H..')[1:3])
salt = salt.translate(string.maketrans(r':;=?@[\]^_`', 'ABDFGabcdef'))
return crypt.crypt(pw, salt)[-10:]
print(get_tripcode("faggot"))
Horribly in-efficient and shitty code for seeing how many tripcodes per second your machine can push. Needs the shit optimizing out of it.
import re,string,crypt,time,math
def get_tripcode(pw):
pw = pw.encode('sjis', 'ignore') \
.replace('"', '"') \
.replace("'", '\'') \
.replace('<', '<') \
.replace('>', '>') \
.replace(',', ',')
salt = re.sub(r'[^\.-z]', '.', (pw + 'H..')[1:3])
salt = salt.translate(string.maketrans(r':;=?@[\]^_`', 'ABDFGabcdef'))
return crypt.crypt(pw, salt)[-10:]
def ts(): return int(time.time())
end = ts() + 60
i = p = 0
while ts() < end:
p = 0
end2 = ts()+1
while ts() < end2:
p=p+1
i=i+1
get_tripcode("string")
lol = "%d tc/s" % (p)
print(lol)
#print("\b") * len(lol)
print "%d tripcodes generated in 60 seconds\nAverage rate: %d tripcodes per second\n" % (i,int(math.ceil(i/60)))
My comp is 0.9GhZ (lolol), and with this script I get around 1500 tc/s
With this script however, I get over 9000 tripcodes a second
<?php
function tripcode($plain)
{
$salt = substr($plain."H.", 1, 2);
$salt = ereg_replace("[^\.-z]", ".", $salt);
$salt = strtr($salt, ":;<=>?@[\\]^_`", "ABCDEFGabcdef");
return substr(crypt($plain, $salt), -10);
}
$end = time()+60;
$i=$p=0;
while(time()<$end)
{
$p=0;$end2 = time()+1;
while(time()<$end2)
{
$p++;$i++;
tripcode(time());
}
echo $p." tc/s";
echo str_repeat("\x08",strlen($p)+5);
}
echo "$i tripcodes generated in 60 seconds\nAverage rate: ".round($i/60)." tripcodes per second\n";
?>
>>314
An interpreted python script that wasn't intended to crack tripcodes is slow at cracking a tripcode? Holy shit, Batman.
That's why all the decent tripcode searchers are written in C.
>>316
You could possibly use Psyco or similar JIT compiler to boost your speed by a significant margin. It's pretty surprising how much faster PHP is, after all it's not a real programming language ;-)
>>319
You're still comparing that PHP code to a function in Python that's designed to produce correct tripcodes, and isn't intended for speed in the first place. If you're going to start benchmarking languages, at least do so competently.
forgive my lack of understanding on this topic, but is it possible to have any tripcode you want, given enough time/resources/whatever?
>>321 here
Sorry, retarded question
What I meant was: I've seen a few trips containing whole 8 letter words, uncanny matches to the poster's name, other things like that. I've used trip.exe and found that the list of trips output for a certain criteria is finite, so my more appropriate question is: is it possible to get EXACTLY the trip you want? if so how?
>>322
It's very unlikely that you could just find an 8 character tripcode that's exactly the one you want it to be, it would possibly take years and years of processing time to find an exact match.
However it might be possible to randomly generate tripcodes and match them against a list of dictionary of 8 letter words, hence you could find full words and then change your name to match the new tripcode. Still wouldn't be very fast though.
>>322
different runs of trip.exe will produce different repeating lists of tripcodes because windows doesn't have random() and it's rand() sucks.
>different runs of trip.exe will produce different repeating lists of tripcode
Interesting, I am running two instances of trip.exe right now, searching for matches to the same string and I'm getting the exact same output from them both.
>>325
If you started them at the same time, that will be the case since the random number generator is seeded by the time in seconds.
Lol, you guys are smart. (Seriously. Not trolling. Some people's knowledge here really impresses me.)
C:\>trip.exe | grep -P \d{10}
`Eqppj9l = 1354773682
eyd!{P0V = 0841327956
I560v;3t = 8550610352
`Eqppj9l = 1354773682
eyd!{P0V = 0841327956
I560v;3t = 8550610352
This took ~4hrs to generate. (lol intel celeron)
>>329
What I'm trying to say is that trip.exe PRNG is terribly cyclic: The more complex the search string, the more likely the PRNG will run around in circles.
Instead of using rand(), which does suck horribly, just use this:
s1=((s1&4294967294)<<12)^(((s1<<13)^s1)>>19);
s2=((s2&4294967288)<<4)^(((s2<<2)^s2)>>25);
s3=((s3&4294967280)<<17)^(((s3<<3)^s3)>>11);
return s1^s2^s3;
Tausworthe random number generator, generates quality 32-bit random integers with a cycle of something like 2^88, extremely fast and simple. Seeding is left as an excercise to the reader, I just set s1, s2 and s3 to the seed times various large integers.
>>333
Nice. Never could get my head 'round bitwise operators, though...
>>333
Cycle of 2^88? So that is not a linear shift feedback whatchamacallit then?
Oh, of course. There are three variables, so the longest possible cycle isn't 2^32, it's 2^96...
I know it's faster, and the state is much, much smaller, but I'm not sure how it stacks up quality-wise. It's supposed to be a viable competitior, though, and it's certainly good enough for pretty much all casual uses.
>>331,333
here's a better one:
z1=((z1&4294967294)<<18)^(((z1<<6)^z1)>>13);
z2=((z2&4294967288)<<2)^(((z2<<2)^z2)>>27);
z3=((z3&4294967280)<<7)^(((z3<<13)^z3)>>21);
z4=((z4&4294967168)<<13)^(((z4<<3)^z4)>>12);
return z1^z2^z3^z4;
Just out of curiosity (I'd like to compare it to the work I'm doing now). How many kilo-crypts per second (kcps) are people getting right now with faster processors out such as a 2.6 ghz core 2 conroe?
>>339
897 mhz/7.15945 kcps
___ ___
/\_ \ /\_ \
\//\ \ ___\//\ \
\ \ \ / __`\\ \ \
\_\ \_/\ \L\ \\_\ \_
/\____\ \____//\____\
\/____/\/___/ \/____/
>>340
Killed non-essential process, 'optimised' my code, now I can get 8.9kcps. VICTOLY.
I hate to rain on your parade there, but I used to get ~100 on similar hardware.
>>342
I'M USING WINDOWS XP HOME EDITION ON AN EMACHINE 130. CONSIDER MY SHITTY PARADE DRY.
339 here.
I'm managing 520kcps with what I wrote in a couple hours, but that doesn't really say much.
I've been running 3 simultaneous instances of trip.exe for ~40 mins now, and got 31 trips matching a case sensitive 5 character string. Quad core's aiiiite.
More notably though, Vista (which I'm using) gives me completely unique results which is nice.
> More notably though, Vista (which I'm using) gives me completely unique results which is nice.
what
> Where's a link to an internet-based tripcode whatever thing?
http://hotaru.thinkindifferent.net/tripper.html
if you have a fast processor and run it in a decently fast browser like opera or safari it might actually be fast enough to be useful.
on my computers here it's horribly slow in firefox (freebsd and windows xp), slightly better in konqueror (freebsd) and IE 7 (windows xp), and almost fast enough to be useful in opera (freebsd and windows xp) and safari (windows xp). and these machines are all more than 2 years old.
>>356
0.4cps on my phone!
And 0.7cps on my DS ite with the DS browser!
To tie this thing into a current conspiracy theory of mine, since you're all talking about tripcode searchers...
Densha Otoko's trip code was nm4g8qV1Cg.
How long would it have taken, realistically, for someone to crack it in 2004? I'm interested in learning at what point it would no longer be plausible for someone to step forward and claim to be him, citing the tripcode as evidence.
(reposted without sage)
To tie this thing into a current conspiracy theory of mine, since you're all talking about tripcode searchers...
Densha Otoko's trip code was nm4g8qV1Cg.
How long would it have taken, realistically, for someone to crack it in 2004? I'm interested in learning at what point it would no longer be plausible for someone to step forward and claim to be him, citing the tripcode as evidence.
use mty or Tripcode Explorer instead. ;)
mty
http://naniya.sourceforge.jp/
Tripcode Explorer
http://tripper.kousaku.in/20050618.html
anyone know of an english translation of Tripcode Explorer?
>>360 A week? a few days? Not long, even back in 2004.
ITT: Idiots who can't even find stable hosting pretending to offer links to their shitty software.
>>360 depends on who that ``someone'' is. Your average otaku? Pretty long. Someone with access to a supercomputer? Probably a day at most.
So what's the status of tripcode decoders for *nix? Everything ITT seems to either be dead links, for windows or slow as hell python.
>>371
http://hotaru.thinkindifferent.net/trip-regex.c
http://hotaru.thinkindifferent.net/trip.c
http://astrange.ithinksw.net/tools/trippersrc.zip
there's also that version of 4brute that uses the bitslice code from john the ripper, but don't ask for it on this board.
>>372
I'm not too familiar with c and I'm getting this error message when compiling trip.c:
>>warning: this decimal constant is unsigned only in ISO C90
which affects lines
>> z1=((z1&4294967294)<<18)^((((z1<<6)^z1)&UINT32_MAX)>>13);
>> z2=((z2&4294967288)<<2)^((((z2<<2)^z2)&UINT32_MAX)>>27);
>> z3=((z3&4294967280)<<7)^((((z3<<13)^z3)&UINT32_MAX)>>21);
>> z4=((z4&4294967168)<<13)^((((z4<<3)^z4)&UINT32_MAX)>>12);
Which seem to be declared by
>>static uint_fast32_t z1,z2,z3,z4;
I also get the error message
>> strcasestr undeclared
which affects the line
>>compare=cflag?&strstr:&strcasestr;
The regex version gets similar errors (though with more errors). The package in trippersrc compiles at least but does so with errors.
Any ideas on if I'm missing packages or something?
Specifically (on the trippersrc):
>>gcc -Os -march=pentium -mtune=generic -std=gnu99 -o 2chdict tdict.c || true
returns
>>tdict.c: In function âmainâ:
>>tdict.c:108: warning: implicit declaration of function âfgetlnâ
>>tdict.c:108: warning: assignment makes pointer from integer without a cast
>>/tmp/cco547v3.o: In function `main':
>>tdict.c:(.text+0xc8c): undefined reference to `fgetln'
>>collect2: ld returned 1 exit status
And doesn't compile 2chdict. tripper2ch doesn't seem to work for 4chan and tripperc4 and trippershii don't seem to do anything.
gcc -std=c99 -O2 -funroll-all-loops `pcre-config --cflags` `pcre-config --libs` -lcrypto -o trip trip-regex.c
or if you don't have pcre and can't install it:
gcc -std=c99 -O2 -funroll-all-loops -lcrypto -o trip trip.c
you're probably better off using trip-regex.c instead of trip.c if you can. if you have to use trip.c, you should grab it again (i just made some minor changes), and if you still get an error about strcasestr not being defined, try compiling it with -DNO_STRCASESTR
.
It needs to use getline instead of fgetln with glibc, because I'm lazy. However, you don't need 2chdit.
>>375
If others are having compile error "optind undeclared" when compiling trip-regex.c, I needed to add
#include <getopt.h>
to the list of includes in trip-regex.c to get it to compile with the command line pasted.
>>380
optind should be in unistd.h
, not getopt.h
.
http://www.opengroup.org/onlinepubs/007908775/xsh/getopt.html
So has anyone been able to write a really optimized one that can work with dual or quad core?
Just run several processes with different random seeds-
I'm sensing that my iPhone getting 800kcps may produce rage.
Someone should thread and compile the regex tripper for Nvidia graphics cards. I can't, my dev machine is blarg dead
sdf
sdf
>>384 is equivalent to any threaded tripper. And easier too, crypt() isn't reentrant :(
Python Image Bord.