Reputation: 8808
How would I go about creating a tripcode system (secure) for a message board I'm custom making? I'm only using PHP and SQL.
Upvotes: 0
Views: 2337
Reputation: 440
Building on what Cetra said, here is an example implementation. I found.
<?php
function tripcode($name)
{
if(ereg("(#|!)(.*)", $name, $matches))
{
$cap = $matches[2];
$cap = strtr($cap,"&", "&");
$cap = strtr($cap,",", ",");
$salt = substr($cap."H.",1,2);
$salt = ereg_replace("[^\.-z]",".",$salt);
$salt = strtr($salt,":;<=>?@[\\]^_`","ABCDEFGabcdef");
return substr(crypt($cap,$salt),-10)."";
}
}
?>
Upvotes: 3
Reputation: 468
Why not just use cypt()'s blowfish, or a substr() of it with a unique salt. There's a lot of fast brute force programs for futaba style trips.
Upvotes: 0
Reputation: 2621
The wikipedia article has an outline for an algorithm you could use for the futaba channel style tripcodes:
As for security? No tripcodes or any hash functions are completely secure from a bruteforce attack, it is more about the computation time required to replicate a tripcode
Upvotes: 3