![]() |
![]() |
|
September 25, 2002Kama-Sutra AlgorithmCan't sleep, and decided to go online to chat with some old friends a couple of hours ago(Started at about 1:30am). Got in a heated debate with Jason about my belief in how cryptography has been around in so many forms, allowing us to win WWII (argue with me all you want dude.. but without the breaking of Enigma.... many a battle would have turned out different. Geeks did more to help win the war than you think. Yet we get very little credit for it.) to the Kama-sutra... useful crypto dates back way before most people think. Anyways, in the middle of all this the gauntlet was thrown down that I can't actually write USEFUL crypto code with just a browser (and no compiler or crypto libs) to deal with what happened way back then. I rarely take on challenges, as I don't need or care to prove myself... but I thought this would be fun enough to make an exception. SO .. to prove you wrong Dr. J..... here is my Kama-sutra algorithm in Javascript *ppfttt* Ok, some background for some of you that have no clue what I am talking about. One of the oldest forms of substitution encryption is dated back to something like the 4th or 5th century in the original writings of the Kama-sutra. Yes the sex box thing. But the Kama-sutra is more than just about the exileration of a hightened awareness of sexual feeling. It stressed highly a recommendation for women to study 64 arts, which ranged from cooking to chess. The 45th art was the art of secret writings, which was supposed to be a way for women to secretly be able to communicate and conceal the details of "relationships" they may have. Now adays I think they call those "Harloquin Romance novels" or something like that. Ok, maybe not. Anyways, the Kama-sutra algorithm is a simple pairing algorithm. In other words, you divide the 26 letters in the alphabet into 13 pairs, matching each other up. A simple example could be something like:
Now, if I wanted to apply the algorithm on a text message such as:
I would replace the M with the N, the e with the F etc etc. After encrypting it,
Sidebar2: Did you notice that using that pairing... foo=epp. How quaint. When I was in junior high, this is how we used to pass notes to each other. Used to piss off the teacher when they confiscated it and wanted to read it to the class. I remember getting in HUGE trouble with the math teacher once, and was forced to explain to the principal what the note said, and how we wrote it. They had a hard time explaining to my grandmother that while in class we were playing with encryption ciphers which was beyond them *laugh*. I had a harder time explaining why I knew what the Kama-sutra was. Anyways.... here is my Kama-sutra algorithm. Dr. J.... I would like the case of Mountain Dew brought up the next time you are in Canada :) Anyways, thats about it. I guess I could make it more intelligent and clean... but I am just trying to show that it is possible with a "mere browser". It is useful enough to actually create Kama-sutra style message either randomly.. or with a pre-shared set of pairs. And of course... the whole reason I started all this was to show it COULD be done in a browser without crypto libs or a compiler, and to get tired so I could go to sleep. Mission accomplished. *yawn* :) Its now almost 4am. I gotta get some sleep before the product demo tomorrow ^H^H^H^H today at 10am. I'm outta here. |
![]() ![]()
My 5 Favorite Books
Writing Secure Code
Secure Programming Cookbook Security Engineering Secure Coding Principles & Practice Inside the Security Mind ![]()
My 5 Favorite Papers
Smashing the Stack
Penetration Studies Covert Channel Analysis of Trusted Systems DoD Trusted Computer System Evaluation Criteria NSA Security Recommendation Guides ![]()
Archives
December 2005
November 2005 October 2005 September 2005 August 2005 July 2005 June 2005 May 2005 April 2005 March 2005 February 2005 January 2005 December 2004 November 2004 October 2004 September 2004 August 2004 July 2004 June 2004 May 2004 April 2004 March 2004 February 2004 January 2004 December 2003 November 2003 October 2003 September 2003 August 2003 July 2003 June 2003 May 2003 April 2003 March 2003 February 2003 January 2003 December 2002 November 2002 October 2002 September 2002 August 2002 July 2002 ![]() |
|