Sunday, November 29, 2009

obscuring an email address with dc(1)

I thought it'd be straightforward, then I realised GNU dc implements P differently than what's in Solaris and HP-UX userland. GNU dc's P is probably more sensible, and can print from 0 to 0xFF, whereas the older dc only prints characters with an ASCII value less than 100 (NUL..'c'). Oh well, the "p" register emulates the old behaviour with newer versions of dc.


echo '1013856546687346707478666470747866sa[la100%PLa100/sa0la>p]splpx' | dc

and with the string factorised and in hexadecimal

echo '16divv7*A7*C7*6ECD29*10449B3E3699B37D83*sa[la64%PLa64/sa0la>p]splpx' | dc

reducing the range by treating '.' as 0...

echo '1059658473306327087662100sa[la40%46+PLa40/sa0la>p]splpx13P10P' | dc

... factorised

echo '2d^3d^*5dv^*17*317*37718099*1930830593*sa[la40%46+PLa40/sa0la>p]splpx10P13P' | dc

No comments: