Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Tripcode decoder?

Name: Anonymous 2007-12-03 19:48

is there anyway to convert a tripcode into the password for that tripcode, im using tripsage and I see that you can put in a word you want to see in a trip code and it produces results of passwords that would produce a tripcode with those letters in it, so if we were to take a complete tripcode someone has and enter it into that field, in theory it should eventually produce the 1 password that produces that tripcode, however i have a core 2 duo e6600 which can run 170,000 crypts per second but with over 10^80 possible combinations(numbers + letters + capital letters + symbols, and 10 characters in a tripcode) it would take litteraly much more than trillions of years to run through every combination. Any other suggestions?

Name: Anonymous 2009-01-27 10:41

NIGGAErgo your fucking stupid bitch and just what are those "before/after bit permutations"? it seems there's very little documentation available about how crypt(3)...
and an implementation in haskell would probably be faster than glibc crypt. There isn't really much more to crypt() than doing 25 rounds of DES and some before/after bit permutations. The most likely reason nobody's written crypt(3) in Haskell is because there's very little point in doing so when there's a perfectly good C implementation (unless you're on Windows, in which case you have two problems). >>515
there's no crypt() there.
If you're so good with the Wikipedia, maybe you also want to check out how crypt() works. Once you have DES it's just a few broken function compositions away.

Name: Anonymous 2009-01-27 17:21

Oh hey, I'm happen to be writing a haskell textboard. Here's my crypt():

c_crypt.h:
char *c_crypt(const char *key,const char *salt);

c_crypt.c:

#define _XOPEN_SOURCE
#include <unistd.h>
#include "c_crypt.h"

char *c_crypt(const char *key,const char *salt){
    return crypt(key,salt);
}


Crypt.hs:

module Crypt.Crypt where

import Foreign.C
import Foreign.Ptr
import Foreign.C.String

foreign import ccall unsafe "c_crypt.h c_crypt" c_crypt :: CString -> CString -> CString


And tripcode function:

--strtr "haxmyanus" "an" "!?" => "h!xmy!?us"
--strtr "haxmyanus" "an" "?"  => "h?xmy??us"
strtr str []     _      = str
strtr str (x:xs) (y:ys) | ys == [] && xs /= [] = strtr' (strtr str xs [y]) x y
                        | otherwise            = strtr' (strtr str xs ys) x y
                      where strtr' [] s r     = []
                            strtr' (q:qs) s r | q == s    = r:strtr' qs s r
                                              | otherwise = q:strtr' qs s r

--strnottr "haxmyanus" "an" '!' => "!a!!!an!!"
strnottr []      _  _ = []
strnottr (s:str) xs y | all (/=s) xs = y:strnottr str xs y
                      | otherwise    = s:strnottr str xs y

--Create 2ch style tripcodes
trip t = do
    csalt <- newCString salt
    ctrip <- newCString t
    fin <- peekCString (c_crypt ctrip csalt)
    return $ (reverse.(take 10).reverse) fin
  where salt = strtr (strnottr (take 2 (drop 1 (t++"H."))) ['.'..'z'] '.') ":;<=>?@[\\]^_`" "ABCDEFGabcdef"

Name: Anonymous 2009-01-27 17:30

Salt should be "H.."

Name: !4I0B18tL8g 2009-01-27 17:48

>>523
I just translated it from the shiichan php

$salt = strtr(preg_replace("/[^\.-z]/",".",substr($trip."H.",1,2)),":;<=>?@[\\]^_`","ABCDEFGabcdef");
.

If it works, my tripcode should be "4I0B18tL8g"

Name: Anonymous 2009-01-27 17:48

>>522
http://cairnarvon.rotahall.org/misc/Tripcode.hs.html

You don't need the .c and .h files. Just compile it with -lcrypt.

>>523
That only makes a difference if you're going to allow empty trips, which most textboards don't anyway.

Name: Anonymous 2009-01-27 17:55

>>525
Ah, thanks Xarn. I had no idea what I was doing since the FFI is poorly documented.

Name: Anonymous 2009-01-27 18:06

That only makes a difference if you're going to allow empty trips, which most textboards don't anyway.
which ones don't besides 4chan?

Name: Anonymous 2009-01-27 18:49

Name: Anonymous 2009-01-27 23:32

>>528
shiitchan and 0ch. that's not even close to "most textboards".

Name: Anonymous 2009-01-27 23:45

>>529
2ch too. The use of ``H..'' rather than ``H.'' is a hack by someone trying to emulate observed 2ch behavior on a different system.

Name: 530 2009-01-27 23:46

>>529
You know what? I misread your post.
What I said in >>530 is still true, though, and using ``H..'' should be considered non-standard. The standard behavior is undefined.

Name: Anonymous 2009-01-28 1:32

2ch too.
2ch uses 0ch. so that's still just two textboard scripts out of how many?

The use of ``H..'' rather than ``H.'' is a hack by someone trying to emulate observed 2ch behavior on a different system.
kareha and wakaba use "H.." to emulate futaba1.
apparently futaba used to use freebsd, but now uses linux (a blank trip resulted in "8NBuQ4l6uQ" in 2004, but now it results in "sgO7UmMnWw")

References:
1: http://wakaba.c3.cx/soc/kareha.pl/1100499906/62

Name: Anonymous 2009-01-28 1:39

>>532
When I said 2ch I meant 2channel, which obviously uses Futaba and thus ``H.'' for the salt.

Name: Anonymous 2009-01-28 1:46

>>533
no, 2ch and 2channel both mean 2ch.net, which uses 0ch, not futaba.
0ch is a textboard script, futaba is an imageboard script.

Name: Anonymous 2009-01-28 9:22

>>532
2ch is by a significant margin the biggest text board in the world, and as it was also the first board to implement tripcodes, it's both the de-facto standard and a suitable reference point for new implementations. Trying to downplay its influence by saying it is only one script is akin to claiming that Google isn't of relevance because it's "just one search engine".

Name: Anonymous 2009-01-28 9:33

Also,
kareha and wakaba use "H.." to emulate futaba1.
Which they do so very poorly. Try this thing:
http://storlek.livejournal.com/58409.html
with input like:
I'm
going&to
"hax"
my, anus

Wakaba gives different results from Futaba on every one of those, and three of the four are different from 0ch as well. Not very "compatible" if you ask me.

Name: Anonymous 2009-01-28 17:49

>>536
If you wanna be compatible, just cut out the part of the Wakaba code that undoes the HTML identities or whatever it does.

Name: Anonymous 2009-01-28 18:13

>>537
No shit Sherlock.

Name: Anonymous 2009-01-28 22:35

>>536
http://hotaru.thinkindifferent.net/trip.html is better.
also, wakaba's version of the tripcode algorithm was mostly the result of trying to figure out what 0ch did without having the source to look at. since 0ch is a lot more widely available now than it used to be it's easy to criticize it, but at least it's not as broken as shiichan.

Name: Anonymous 2009-01-29 3:09

>>539
That has a clumsier interface, not as many algorithms, and only shows one tripcode with one substitution at a time. Otherwise it looks like it just ripped off the code and converted it to JAVASCRIPT. How does that make it better?

Name: Anonymous 2009-01-29 4:59

clumsier interface
What.

not as many algorithms
It has all the ones that anyone uses. And a few that that other script doesn't support (but no one uses), like 0ch with UTF-8 and Shiichan with Shift-JIS.
Seriously, the number of PyIB boards in existence is less than three, Trevorchan/Kusaba is a steaming pile of shit which no sane person would ever use, Thorn is dead, and Pixmicat is just a broken version of futaba that no one uses.

only shows one tripcode with one substitution at a time.
That's not really a problem because of the much better interface.
You probably just haven't figured out that you can type in a tripcode and then change the options below and the result will automatically update.

Otherwise it looks like it just ripped off the code and converted it to JAVASCRIPT.
Okay, let's compare this:
_re_waha_decodestr = re.compile(r'&#(?:([0-9]*)|([Xx&])([0-9A-Fa-f]*))([;&])')
_re_waha_cleanstr = re.compile(r'&(#([0-9]+);|#x([0-9A-Fa-f]+);|)')
_re_waha_stripctrl = re.compile(r'[\x00-\x08\x0b\x0c\x0e-\x1f]+')

@tripper('wakaba')
def trip_wakaba(key):
    def dec_or_hex(d, h):
        try:
            return (int(d) if d else int(h, 16))
        except:
            return 0
    def forbidden(o):
        return o > 1114111 or o < 32 or 0xd800 <= o <= 0xdfff or 0x202a <= o <= 0x202e
    def decode_string(m):
        d, xamp, h, end = m.groups()
        o = dec_or_hex(d, h)
        if '&' in (end, xamp):
            return m.group(0)
        elif forbidden(o):
            return ''
        elif o in (35, 38):
            return m.group(0)
        else:
            return unichr(o)
    def clean_string(m):
        g, d, h = m.groups()
        if not g:
            return '&amp;'
        elif forbidden(dec_or_hex(d, h)):
            return ''
        else:
            return m.group(0)

    key = _re_waha_decodestr.sub(decode_string, key)
    key = key.encode('sjis', 'xmlcharrefreplace')
    key = (_re_waha_cleanstr.sub(clean_string, key)
        .replace('<', '&lt;')
        .replace('>', '&gt;')
        .replace('"', '&quot;')
        .replace('\'', ''')
        .replace(',', ',')
    )
    key = _re_waha_stripctrl.sub('', key)
    salt = (key + 'H..')[1:3].translate(_salt_table)
    return key, salt

with this:
function subst_waha(key, conv){
return conv(key.replace(/&#([0-9]*)([;&])|&#([x&])([0-9a-f]*)([;&])/g,
                 function(str, p1, p2, p3, p4, p5, o, e){
                  var ord = p2 ? p2.charCodeAt(0) : parseInt(p5, 16);
                  if(p3 == '&' || p4 == '&' || p5 == '&') return str;
                  if(waka_forbidden(p2, p5)) return '';
                  if(ord == 35 || ord == 38) return str;
                  return String.fromCharCode(ord); })
               .replace(/&(#([0-9]+);|#x([0-9a-fA-F]+);|)/g,
                 function(str, p1, p2, p3, o, e){
                  if(p1 == '') return '&amp;';
                  if(waka_forbidden(p2, p3)) return '';
                  return str; })
               .replace(/</g, '&lt;')
               .replace(/>/g, '&gt;')
               .replace(/"/g, '&quot;')
               .replace(/'/g, ''')
               .replace(/,/g, ',')
               .replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x{fffe}\x{ffff}]/g, ''));
}

function waka_forbidden(dec, hex){
 if(dec.length > 7 || hex.length > 7) return true;
 ord = parseInt(dec, 10) ? parseInt(dec, 10) : parseInt(hex, 16);
 if(ord > 0x10ffff || ord < 32 || (ord >= 0xd800 && ord <= 0xdfff) ||
    (ord >= 0x202a && ord <= 0x202e) || (ord >= 0xfffe && ord <= 0xffff)) return true;
 return false;
}


The JavaScript code is shorter and less convoluted, and is a lot more similar to the Perl code in Wakaba than to that wacky python code.

How does that make it better?
There's also the fact that it actually works, unlike that unreadable pile of forced indentation:
Traceback (most recent call last):
  File "./kigou", line 9, in <module>
    import pygtk
ImportError: No module named pygtk

Name: Anonymous 2009-01-29 8:20

It has all the ones that anyone uses. And a few that that other script doesn't support (but no one uses), like 0ch with UTF-8 and Shiichan with Shift-JIS.
Seriously, the number of PyIB boards in existence is less than three, Trevorchan/Kusaba is a steaming pile of shit which no sane person would ever use, Thorn is dead, and Pixmicat is just a broken version of futaba that no one uses.

You just contradicted yourself.
Also, it still includes "matsuba", which as far as I can tell exists on exactly one board that's apparently run by the same person who made that script.

The obvious benefit of having all of the results listed at the same time, which you seem to be failing to comprehend, is being able to tell whether a given tripcode will work on various boards. Having to repeatedly change a dropdown several times defeats that, and it's completely unnecessary.

wacky python code
unreadable

Eh. I wouldn't so so far as to say it's blatantly obvious what everything does (I still don't understand what the hell the add_tripcode function is doing) but if you take a moment to read it, and assuming you actually know Python, it's far from unreadable.

ImportError: No module named pygtk
Get a less shitty system. Gtk is a pretty standard toolkit, and pygtk isn't that big.

I think that javascript tripcode thing is pretty much like all of hotaru's stuff: technically interesting because of the implementation (DES in Javascript; running twelve different imageboard scripts all at once; building a textboard based on some ass-backwards hack, that WAHa even openly stated was a joke and a terrible idea) -- but aside from that, fundamentally useless and devoid of any actual, practical benefit.

Name: Anonymous 2009-01-29 8:27

Oh, almost forgot: the hotaru tester provides no way to tell what the raw input to crypt was. That's useful for figuring out how to "translate" a weird tripcode to use on another board.

(And it gives laughably incorrect results for anything that's not ascii.)

Name: Anonymous 2009-01-29 9:32

>>542
Shiichan with Shift-JIS
I thought /sjis/ used Shift-JIS, but I just checked and it uses UTF-8. How lame, I feel cheated.

Name: Anonymous 2009-01-29 9:34

>>544
UTF-8 is the common standard.

Name: Anonymous 2009-01-29 9:57

>>545
But the board is called SJIS Room!

Name: Anonymous 2009-01-29 10:02

>>546
The website is located in America.

Name: Anonymous 2009-01-29 10:11

>>547
Leah Culver is located on My Dick.

Name: Anonymous 2009-01-29 10:15

>>548
Permanently?

Name: Anonymous 2009-01-29 10:57

(And it gives laughably incorrect results for anything that's not ascii.)
what.
kami works fine (yGAhoNiShI for shift-jis)...

Also, it still includes "matsuba", which as far as I can tell exists on exactly one board that's apparently run by the same person who made that script.
except that i actually happen to occasionally visit that one site that runs matsuba.

The obvious benefit of having all of the results listed at the same time, which you seem to be failing to comprehend, is being able to tell whether a given tripcode will work on various boards.
something like this? http://hotaru.thinkindifferent.net/triplist.html
but why would you bother with that when it's usually pretty obvious whether a tripcode will work on various boards or not?

the hotaru tester provides no way to tell what the raw input to crypt was. That's useful for figuring out how to "translate" a weird tripcode to use on another board.
there are much better ways to do that.

Name: Anonymous 2009-01-29 14:54

>>550
Have you tried actually changing the options? You know, using it.

Name: Anonymous 2009-01-29 19:10

>>551
yes, i have.
are you saying that it doesn't work correctly for some particular input? if so, what input?

Name: !/Rjb1eElt. 2009-01-31 9:05

test

Name: !xSanaekL72 2009-02-11 6:38

test

Name: Anonymous 2009-02-11 6:39

test

Name: !wmxP/NHJxA 2009-02-11 7:31

test

Name: Anonymous 2009-02-11 7:32

test

Name: Anonymous 2009-02-11 7:50

test

Name: !xH8pKGQgrI 2009-02-11 7:51

test

Name: Anonymous 2009-02-11 7:54

'

Newer Posts