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.
Someone explain the process for generating tripcodes anyway.
I'm goofing around teaching myself php and want to make a tripcode test script for the hell of it.
That'd be re-inventing the wheel. Here's the (slightly poorly-written) snippet of code from Thorn that generates 2ch-style trips:
$pos=strrpos($name,"#");
if ($pos!==false) {
$nombre=substr($name,0,$pos);
$trip=substr($name,$pos+1);
//echo($trip);
//2ch-style tripcodes...
//More or less stolen from Futallaby
$salt=substr($trip."H.",1,2);
$salt=ereg_replace("[^\.-z]",".",$salt);
$salt=strtr($salt,":;<=>?@[\\]^_`","ABCDEFGabcdef");
$trip=substr(crypt($trip,$salt),-10)."";
}
else {
$nombre=$name;
$trip="";
}
The point of re-inventing the wheel is that you understand it better and aren't just copying stuff you saw other people do. As it is I can't make heads or tails of your code.
To tell the truth, I have a hard time following it too. Why? Because (as the comments say) it was lifted with few modifications from another (open-source) PHP image board script. And the guy who wrote that probably transcribed it from another image/message board script written in Perl. So I didn't reinvent the wheel either. But you know what? It works.
I'll write it out a bit
$salt=substr($trip."H.",1,2);
Take the second and third characters of the trip key with "H." appended to the end of it. This is the "salt."
$salt=ereg_replace("[^\.-z]",".",$salt);
Replace characters that don't match the regular expression [^\.-z] (basically, non-ASCII characters) with a period.
$salt=strtr($salt,":;<=>?@[\\]^_`","ABCDEFGabcdef");
Replace a bunch of characters that are ASCII but not letters with letters. Remember that "\\" in this case is an escaped "\".
$trip=substr(crypt($trip,$salt),-10)."";
The trip code is the last ten characters of the result of a standard UNIX encryption function, with the trip key and the salt as input. http://us3.php.net/crypt
Wanna rewrite that in your own code? Have fun.
To get it entirely right, you should probably apped "H.." instead of "H.". Also, you should convert from whatever charset you are using to Shift_JIS before doing anything else.
Would conversion to Shift-JIS really make a difference, seeing as it's only working with ASCII characters anyway?
It's not only working with ASCII characters. It's working with the full 8-bit bytes.
For instance, #ÃÂÃÂÃÂÃÂÃÂÃÂÃÂïÃÂÃÂÃÂÃÂÃÂÃÂÃÂýÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂïÃÂÃÂÃÂÃÂÃÂÃÂÃÂýÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ�ÂÃÂÃÂÃÂÃÂÃÂÃÂïÃÂÃÂÃÂÃÂÃÂÃÂÃÂýÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂïÃÂÃÂÃÂÃÂÃÂÃÂÃÂýÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ� doesn't work if you don't convert to Shift_JIS, and furthermore, tripcodes will change depending on the charset of the board.
...and now, it's not working here. Seems I've got some fresh new bugs to sort out.
Righteous.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>whee</title>
</head>
<body>
<?php
@header('Content-type: text/html; charset=utf-8');
if (function_exists("mb_internal_encoding")) {
//This server will support multi-byte strings. Unicodey goodness!
mb_internal_encoding("UTF-8");
mb_language("uni");
mb_http_output("UTF-8");
}
error_reporting(E_ALL^E_NOTICE);
if(isset($_POST['nombre'])==true){
$name=explode("#",$_POST['nombre']);
$trip=array_pop($name);
$name=array_pop($name);
$trip=mb_convert_encoding($trip,"SJIS");
$salt=substr($trip."H.",1,2);
$salt=ereg_replace("[^\.-z]",".",$salt);
$salt=strtr($salt,":;<=>?@[\\]^_`","ABCDEFGabcdef");
$trip=substr(crypt($trip,$salt),-10)."";
$trip=mb_convert_encoding($trip,"UTF-8");
?>
<p><?php echo("<strong>".$name."</strong>!".$trip); ?></p>
<?php
}
?>
<form method="post" enctype="multipart/form-data" action="index.php">
<input type="text" size="20" name="nombre" /><input type="submit" />
</form></body></html>
This'll go into Thorn 2.
http://astrange.ithinksw.net/tools/trippersrc.zip
Now endian-safe, slightly slower on icc, much faster on gcc.
Switched to FreeBSD crypt() because it's much shorter. Unfortunately also much more bottlenecked in one random-access array lookup that goes to main memory. Didn't switch to the JTR code WAHa sent me because it would ruin my beautifully short program.
Also I forgot to add modern wakaba trips but I'll do it sometime.
This crypt isn't reentrant :(
>>237
freebsd crypt() is faster than openssl crypt on my laptop (turion, 64-bit freebsd), but it's slower on the machine i'm using now (pentium 3, 32-bit freebsd)... i wonder why?
This thread has blown my mind.
I'm an internet dumbass and a computer illiterate; how do I even run that program?
>>243
I am by no means a linux/unix expert, but I assume that you compile it by running "build.sh" script and run the executable from the command line?
>>245
yeah no problem if it would even build on my end
tripper.c:23:28: error: mach/mach_time.h: No such file or directory
tripper.c:23:28: error: mach/mach_time.h: No such file or directory
In file included from tripper.c:28:
sha1.c: In function ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂearray_swapÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂf:
sha1.c:96: warning: implicit declaration of function ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂehtonlÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂf
tripper.c:23:28: error: mach/mach_time.h: No such file or directory
tdict.c: In function ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂemainÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂf:
tdict.c:108: warning: implicit declaration of function ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂefgetlnÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂf
tdict.c:108: warning: assignment makes pointer from integer without a cast
/tmp/ccQVniCX.o: In function `main':
tdict.c:(.text+0xcce): undefined reference to `fgetln'
collect2: ld returned 1 exit status
redownload
I'm not going to bother rewriting tdict to use getline() just because glibc is crazy though :(
'
hay guyz, wuts goin on in dis tread?
I'd kill or die for a windows version of a decent tripcode decoder. Failing that, instructions for an idiot. I like YEAH but I'd like to make more. This was a pain in the ass to get.
<3
FBI has deleted all links... how sad
So.. how does this work? All I get is a command prompt spamming with tripcodes and what they convert into, but doesn't seem to dump anywhere that I can see.
>>255trip <string>
to find tripcodes containing <string> (case insensitive)trip -c <string>
to find tripcodes containing <string> (case sensitive)
there's also http://hotaru.thinkindifferent.net/fasttrip-regex.tar.bz2, which supports regexes.
>>256
What? Where do I put that?
In a txt file or something?
This shit's useful ~desu
trip -c <ROFLCOPTER>
XD
Thanks, dude!
I found a tripcode that I've been looking for with Tripper+. However, it uses a non-standard character, "¼". Is there something that will convert that character into either kanji or a standard numeral or letter?
Thanks in advance.
>>264
¼ = U+00BC
0xBC in Shift-JIS = U+FF7C (http://wakaba-web.hp.infoseek.co.jp/table/sjis-0208-1997-std.txt)
U+FF7C = ÃÂÃÂÃÂÃÂÃÂÃÂÃÂü
>>265
oh, and now i know how to make this tripcode work ^^
>>265
Thanks a lot. Unfortunately, my trip's still not working, though.
>>267
it might have other characters you need to convert...
or if it has any of the characters that are converted to html entities (i think just ,<>"'&) it might not work at all... i'm not sure if tripper+ handles those correctly...
>>268
There's a ~ and / in it, but I don't think those would pertain to HTML entities.
>>269
where are you trying to use it? if it doesn't contain any of the characters mentioned in >>268 and you've converted any characters that aren't the same in unicode and shift-jis it should work on wakaba and kareha boards.
futallaby and shiichan (at least the versions used on 4chan) are apparently horribly broken wrt tripcodes.
ok, apparently such tripcodes can be made to work on 4chan.
you just have to set the character encoding to shift-jis before you post.
> futallaby and shiichan (at least the versions used on 4chan) are apparently horribly broken wrt tripcodes.
they're interpreted as utf-8, except on /sjis/ where they aren't. official policy is to not fix this because we hate people who use tripcodes.
sage lol
Trip works alright, but do any other generators that run under Windows do strings that aren't 8 characters long? Seems like it's pretty limited by that, and it repeats them pretty often.
well, this one has no html entities...
LOL FAIL
seeking 4brute-johnbs.... or some better glue for x86-sse.S (etc)
I've had some luck using OpenSSL's crypt, but I'm struggling to get the right bits in and out of john's bitslicing DES code.
Have a look at vectripper. It's written for OS X but it uses john.
> seeking 4brute-johnbs
you won't get it on this board.
... indeed. After reading through the entire thread, and seeing this place's visibility on google, I can understand why nobody is just going to hand over the code to me...oh well. I'm making progress hacking something together. VecTripper's source hurts my eyes so I'm just sticking to peekin' through John. Reinventing the wheel sucks by the way...
I noticed an odd property of tripcodes (well, crypt actually): the last character will always be one of [.26AEIMQUYcgkosw] -- one of every fourth character in the overall character set.
DES output is 64 bits. It is encoded into a string consisting of characters from a set of 64, meaning each character encodes 6 bits. The output is 11 characters long, which adds up to 66 bits, the two last of which thus go unused. A loss of two bits means every fourth character is used.
Hmm. Maybe it'd've been better to substr($crypted, 2, 10)
to get more useful bits? Oh well, too late now.
Anybody have a link to hotaru's tripcode program? I've tried tripper+, but it can't find the same ones his did.
>>293
source:
without regex
with regex
windows binaries:
without regex
with regex
>>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.