Thursday, June 24

The Caesar Cipher

I made the little Rot-13 conversion app in SuperCard, adapting an algorithm I found on the Web. Part of being a smart developer means not reinventing the wheel. I could have developed my own method, using "" statements, but this way was much more elegant -- using the ASCII numbers of letters. The actual mathematical formula was what I culled, but I still had to retrofit this to work in SuperCard, and I'm unreasonably pleased with this little toy. Here's the text of this post rotated 13 letters through the alphabet.

V znqr gur yvggyr Ebg-13 pbairefvba ncc va FhcrePneq, nqncgvat na nytbevguz V sbhaq ba gur Jro. Cneg bs orvat n fzneg qrirybcre zrnaf abg ervairagvat gur jurry. V pbhyq unir qrirybcrq zl bja zrgubq, hfvat "fjvgpu...pnfr" fgngrzragf, ohg guvf jnl jnf zhpu zber ryrtnag -- hfvat gur NFPVV ahzoref bs yrggref. Gur npghny zngurzngvpny sbezhyn jnf jung V phyyrq, ohg V fgvyy unq gb ergebsvg guvf gb jbex va FhcrePneq, naq V'z haernfbanoyl cyrnfrq jvgu guvf yvggyr gbl. Urer'f gur grkg bs guvf cbfg ebgngrq 13 yrggref guebhtu gur nycunorg.

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?