tag:blogger.com,1999:blog-77414492121468518802018-05-28T20:28:38.591-07:00CryptomathematicsRandom blurb on cryptography and mathematics.Tartagliahttp://www.blogger.com/profile/04414674457987123651noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7741449212146851880.post-6083142212644341782011-02-12T12:47:00.000-08:002011-02-12T12:51:59.776-08:00The Caesar CipherI decided to start with the Caesar cipher for my first tutorial. It is relatively simple and contains some important concepts in cryptography. It also has some rich history behind it. I will include a programming algorithm for it at the end, in Java, if the reader is interested.<br /><br /><b>History</b><br /><br />It is named after Julius Caesar who used it to encrypt messages of military and personal significance. Cryptography was not in wide use, or even known to exist, in this era, so it was very effective despite it's very simple implementation. The majority of his enemies would have also been illiterate.<br /><br /><b>How It Works</b><br /><br />The Caesar cipher works by shifting the letters of the alphabet. For example, A would become D, and B would become E. It is not a safe encryption system and can be broken relatively easily. If you use this to hide value information, it won't be hidden for long. A very popular use of the Caesar cipher is ROT13, which stands for Rotational 13. ROT13 works by shifting each letter of the alphabet by 13 places.<br /><br />Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ<br />Cipher: NOPQRSTUVWXYZABCDEFGHIJKLM<br /><br />The message "Cryptomathematics is awesome" becomes: "Pelcgbzngurzngvpf vf njrfbzr"<br /><br />The shift can also be represented mathematically as:<br /><br />E(x) = (x + n) mod 26<br /><br />Where x is being shifted and n is the value to shift by. Decryption is performed similarly:<br /><br />D(x) = (x + n) mod 26<br /><br />The modular operator keeps it in a discrete structure, so that if you add a shift that takes you out of the range fo the alphabet, you stay inside. It's basically a loop. Since the alphabet is 26 characters long, we use mod 26. I've always found it interesting that modular arithmetic is very important to advanced mathematics, particularly number theory and cryptography, yet people use this all day. We use this system for time! Think of a clock. You don't say it is 13 o'clock (we're not using military time here), you say 1 o'clock. A clock would be represented the same way mathematically if you wanted to see what time it would be in, say, 5 hours, except you would use mod 12.<br /><br />If you wish to learn more about modular arithmetic, go <a href="http://www.youtube.com/watch?v=SR3oLCYoh-I">here</a>.<br /><br />Anyways, I promised a programming algorithm and I shall deliver.<br /><br />String encodedMessage = "";<br />for (int i = 0; i < plainText.length(); i++) {<br />char c = plainText.charAt(i);<br />if (c >= 'a' && c <= 'm'){ <br />c += 13;<br />} else if (c >= 'n' && c <= 'z'){<br />c -= 13;<br />} else if (c >= 'A' && c <= 'M'){<br />c += 13;<br />} else if (c >= 'N' && c <= 'Z'){<br />c -= 13;<br />}<br />encodedMessage += c;<br />}<br /><br />I've seen a lot of algorithms for the ROT13 cipher and Java is definitely not the most elegant, but Java is what I'm learning. And since you're rotating by 13 characters (26/2 = 13) you can use the same piece of code to decode the encoded message.<br /><br />If anyone knows how to embed code on here, I'd be grateful if you told me how!<img src="http://feeds.feedburner.com/~r/Cryptomathematics/~4/_6-jaP9xSwY" height="1" width="1" alt=""/>Tartagliahttp://www.blogger.com/profile/04414674457987123651noreply@blogger.com0http://cryptomathematics.blogspot.com/2011/02/caesar-cipher.htmltag:blogger.com,1999:blog-7741449212146851880.post-18730994255779924202011-02-11T23:22:00.000-08:002011-02-11T23:22:11.724-08:00Is Mathematics Eternal?<a href="http://www.closertotruth.com/video-profile/Is-Mathematics-Eternal-Gregory-Chaitin-Part-1-of-2-/1435">Is Mathematics Eternal? Pt. 1</a><br /><a href="http://www.closertotruth.com/video-profile/Is-Mathematics-Eternal-Gregory-Chaitin-Part-2-of-2-/1436">Is Mathematics Eternal? Pt. 2</a><br /><br />Very interesting conversation between Robert Kuhn and Gregory Chaitin, a mathematician and computer scientist at IBM's Thomas J Watson Research Center. The Research Center is renowned for it's eccentric employees, Nobel Prizes, and technological breakthroughs.<br /><br />Gregory Chaitin's field is algorithmic information theory which is the focus of complexity on strings or other data structures. Informally, from the point of view of algorithmic information theory, the information content of a string is equivalent to the length of the shortest possible self-contained representation of that string. For example, a 3000 page encyclopedia contains less information than 3000 pages of completely random letters, even if the encyclopedia is more useful. The reason why 3000 pages of completely random letters contains more information is because to reconstruct it, you would have to know every single letter contained in the pages. A person with reason could reconstruct the encyclopedia if all the vowels were removed.<img src="http://feeds.feedburner.com/~r/Cryptomathematics/~4/8CgcVdXqt_0" height="1" width="1" alt=""/>Tartagliahttp://www.blogger.com/profile/04414674457987123651noreply@blogger.com1http://cryptomathematics.blogspot.com/2011/02/is-mathematics-eternal.htmltag:blogger.com,1999:blog-7741449212146851880.post-49782983873258442632011-02-10T15:09:00.000-08:002011-02-10T15:12:20.701-08:00The BeginningFirst post.<br /><br />I decided to make this blog to blurb about cryptology and mathematics, my main interests in life! I'm a math major in University and will post interesting concepts I come across, news, or tutorials.<br /><br />I recently programmed a simple RSA string encryption program, so my first tutorial will have something to do with the RSA algorithm. The tutorial is coming very soon.<br /><br />Follow me if you enjoy cryptology or math!<img src="http://feeds.feedburner.com/~r/Cryptomathematics/~4/8D2KRPgnAko" height="1" width="1" alt=""/>Tartagliahttp://www.blogger.com/profile/04414674457987123651noreply@blogger.com17http://cryptomathematics.blogspot.com/2011/02/beginning.html