/***********************************************
 * 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 <signal.h>
#include <ctype.h>
#include <stdlib.h>

#define charput(x) if(!(x=='\n'||x=='\0'||x=='\r')) putchar(x)
#define randi(x) (int)((int) ((float)(x)*rand()/(RAND_MAX+1.0)))

void clearANSI(int s){
     puts("\033[m\n");
     exit(1);
}
char scrmbl (char letter);

char charset[] = " !\"#$%&'()*+,-./"
                 "0123456789"
                 ":;<=>?@"
                 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                 "[\\]^_`"
                 "abcdefghijklmnopqrstuvwxyz"
                 "{|}~";


int
main (int argc, char *argv[])
{

  int g;
  char *argp = argv[1];
  if (argc < 2)
    {
      printf ("need string.\n");
      exit (-1);
    }
  signal(SIGINT, clearANSI);
  signal(SIGTERM,clearANSI);
  signal(SIGSEGV,clearANSI);

  setvbuf (stdout, (char *) NULL, _IONBF, 0);
  srand(time (NULL));


  for (;;*++argp)
    {
      if (*argp == '\0')
	{
	  printf ("\033[m\n");
	  exit (0);
	}
      printf ("\033[0;32m");
      scrmbl  (*argp);
      printf ("\033[1;32m");
      charput (*argp);
    }
}


char
scrmbl (char letter)
{
  int s;
  for (s=randi(strlen(charset));
       charset[s]!=letter;
       s=(int)randi((strlen(charset)-1)))
    {

      rand();
      rand();
      rand();
      rand();

      if (isascii(charset[s]))
      {
          charput (charset[s]);
          usleep (randi(200000));
          charput ('\b');
      }
    }
}


syntax highlighted by Code2HTML, v. 0.9.1