/***********************************************
 * released under (E) licensing ...            *
 *        (E) RULES AND REGULATIONS            *
 * permission to use/rewrite/add     : granted *
 * permission to trojan/steal        : denied  *
 * permission to use illegally       : denied  *
 * permission to use on /dev/urandom : denied  *
 ***********************************************/
/* contact el8@press.co.jp for full license    */
/* code copyrighted by ~el8 -- don't infringe! */

#include <stdio.h>
#include <termios.h>

char toleet(char ch)
{
   char ich = (ch|32);

   if (ich == 'a')
      return (1 == (rand() % 3)) ? '4' : ch;
   else if (ich == 'b')
      return (1 == (rand() % 3)) ? (1 == (rand() % 4)) ? '8' : '6' : ch;
   else if (ich == 'c')
      return (1 == (rand() % 5)) ? (1 == (rand() % 2)) ? '(' : '<' : ch;
   else if (ich == 'd')
      return ch;
   else if (ich == 'e')
      return (1 == (rand() % 2)) ? '3' : ch;
   else if (ich == 'f')
      return ch;
   else if (ich == 'g')
      return (1 == (rand() % 6)) ? '9' : ch;
   else if (ich == 'h')
      return ch;
   else if (ich == 'i')
      return (1 == (rand() % 2)) ? (!(rand() % 2)) ? '|' : '1' : ch;
   else if (ich == 'j')
      return ch;
   else if (ich == 'k')
      return ch;
   else if (ich == 'l')
      return (1 == (rand() % 7)) ? '|' : ch;
   else if (ich == 'm')
      return ch;
   else if (ich == 'n')
      return ch;
   else if (ich == 'o')
      return (1 == (rand() % 2)) ? (!(rand() % 2)) ? '@' : '0' : ch;
   else if (ich == 'p')
      return ch;
   else if (ich == 'q')
      return ch;
   else if (ich == 'r')
      return ch;
   else if (ich == 's')
      return (1 == (rand() % 2)) ? (!(rand() % 2)) ? '5' : '$' : ch;
   else if (ich == 't')
      return (!(rand() % 4)) ? '7' : ch;
   else if (ich == 'u')
      return ch;
   else if (ich == 'v')
      return ch;
   else if (ich == 'w')
      return ch;
   else if (ich == 'x')
      return ch;
   else if (ich == 'y')
      return ch;
   else if (ich == 'z')
      return (!(rand() % 10)) ? '2' : ch;
   else
      return ch;
   return -1;
}

int main()
{
   struct termios fu, ck;
   char ch;

   srand(time(0));
   tcgetattr(0, &ck);
   fu = ck;
   ck.c_lflag &= ~(ECHO | ICANON);
   tcsetattr(0, TCSANOW, &ck);
   while ((ch = getchar()) != EOF) {
      if (ch == 127) {
         putchar("\b \b"[0]);
         putchar("\b \b"[1]);
         putchar("\b \b"[2]);
         continue;
      }
      putchar(toleet(ch));
   }
   tcsetattr(0, TCSANOW, &fu);
}


syntax highlighted by Code2HTML, v. 0.9.1