The Homepage for RotNN.py

The aging process has you firmly in its grasp if you never get the urge to throw a snowball. - Doug Larson

[Information | Details | Examples | Download | Links | About]


Information

RotNN is now used in Vigen.py. My works pays off for myself. 8^) [2001-04-19]


I don't even recall why I wrote RotNN.py anymore. I guess it was just one of those things, the itch that I needed to scratch that day. It's grown from it's rot-13 root into what it is today - a library that will do alphabetical rotation by any number you want. How useful this really is is debateable. 8^)

Most of the documentation here I have stripped from the README file. I'm lazy, sue me.


Details

rotate (string, optional_number=13]): Your standard rot-13-ish type rotation. Case is preserved. .rotate is symmetrical which means that two of the default .rotates will return you to your original string.

unrotate (string, optional_number=13): Same as above, only the opposite direction.

srotate (string, optional_number=47): Rotates over the entire character set. This function is not symmetrical. You have to .sunrotate it to get it back.

sunrotate (string, optional_number=47): Same as above.

wrotate (string, optional_number=47): Rotates over the entire character set except it preserves spacing. See the examples for a demonstration of this. This routine is symmetrical.

wunrotate (string, optional_number=47): Same as above, except in the opposite direction.


Download


Examples

.rotate example: rot-13 is commonly used to obfuscate text that people don't want inadvertantly read. For instance...

You know, at the ending of the movie where Colonel Halpablatt is revealed to be both the Dark Undertaker, the Detective and Betty Sue's father at the same time?! Boy, was I surprised! And to think, by seeing this preview showing, I know all this stuff before it hits the general public!
Post this to a movie newsgroup and risk getting your house firebombed. However, if you would post something like this...
For my thoughts on the ending of ROCKY XXV, rot13 the following:
Lbh xabj, ng gur raqvat bs gur zbivr jurer Pbybary Unycnoyngg vf erirnyrq gb or obgu gur Qnex Haqregnxre, gur Qrgrpgvir naq Orggl Fhr'f sngure ng gur fnzr gvzr?! Obl, jnf V fhecevfrq! Naq gb guvax, ol frrvat guvf cerivrj fubjvat, V xabj nyy guvf fghss orsber vg uvgf gur trareny choyvp!
No one could say that you ruined it prematurely for them.

.srotate and .wrotate example(s): Rotnn.srotating (by 30) the LICENSE file gives us this...

t$12(.->PLOJ>d$!14 18>OWWW
a./81(&'3>FaG>OWWOJ>OWWW>d1$$>q.%36 1$>d.4-# 3(.-J>g-"L
SW>r$,/+$>n+ "$J>q4(3$>QQNJ>`.23.-J>k_>>NPOOOKOQNU>>sq_
c5$18.-$>(2>/$1,(33$#>3.>"./8> -#>#(231(!43$>5$1! 3(,>"./($2
.%>3'(2>+("$-2$>#."4,$-3J>!43>"' -&(-&>(3>(2>-.3> ++.6$#L yr'(2>(2>3'$>%(123>1$+$ 2$#>5$12(.->.%>3'$>j$22$1>enjL>>g3> +2.>".4-32
> 2>3'$>24""$22.1>.%>3'$>els>j(!1 18>n4!+(">j("$-2$J>5$12(.->PJ>'$-"$
>3'$>5$12(.->-4,!$1>PLOL{
...and so on and so forth. Kewl, eh? Watch what wrotate does to the same file...
t%23)/. PLOJ d%"25!29 OWWW
a/092)'(4 FaG OWWOJ OWWW d2%% q/&47!2% d/5.$!4)/.J g.#L
SW r%-0,% n,!#%J q5)4% QQNJ `/34/.J k_  NPOOOKOQNU  sq_
c6%29/.% )3 0%2-)44%$ 4/ #/09 !.$ $)342)"54% 6%2"!4)- #/0)%3
/& 4()3 ,)#%.3% $/#5-%.4J "54 #(!.').' )4 )3 ./4 !,,/7%$L yr()3 )3 4(% &)234 2%,%!3%$ 6%23)/. /& 4(% j%33%2 enjL  g4 !,3/ #/5.43
 !3 4(% 35##%33/2 /& 4(% els j)"2!29 n5",)# j)#%.3%J 6%23)/. PJ (%.#%
 4(% 6%23)/. .5-"%2 PLOL{
It's a little hard to see (Way to go Adam -- give 'em a cruddy example...), but wrotate retains the original spacing of the file - possibly a big clue to someone trying to guess what you did to it. However, watch what happens when we srotate the rotnn source...
AAAAAAAAAAAAAAAAAAAAAAAA%*#4!.+56O#22'0&AI%*4I14&!%*#4ALA#/1706JJ
AAAAAAAAAAAAAAAA'.+(AIIZRN#/1706JA]^A14&!%*#4A]^AZQJ[
AAAAAAAAAAAAAAAAAAAAAAAA%*#4!.+56O#22'0&AI%*4IWVALAI#/1706ANAIZRANA14&!%*#4JJJJ
AAAAAAAAAAAAAAAA'.+(AIIRSTN#/1706JA]^A14&!%*#4A]^ARSSJ[
AAAAAAAAAAAAAAAAAAAAAAAA%*#4!.+56O#22'0&AI%*4IZXALAI#/1706ANAIRSTANA14&!%*#4JJJJ
AAAAAAAAAAAAAAAA'.5'[
AAAAAAAAAAAAAAAAAAAAAAAA%*#4!.+56O#22'0&AI%*4I14&!%*#4JJ
Man, look at those A's! Wouldn't take long for someone to figure out what's going on here. Let's wrotate it instead...
                        &+$5"/,67O$33(1' I&+5I25'"&+$5 L $02817JJ
                (/,) IIZRN$02817J ]^ 25'"&+$5 ]^ ZQJ[
                        &+$5"/,67O$33(1' I&+5IWV L I$02817 N IZR N 25'"&+$5JJJJ
                (/,) IIRSTN$02817J ]^ 25'"&+$5 ]^ RSSJ[
                        &+$5"/,67O$33(1' I&+5IZX L I$02817 N IRST N 25'"&+$5JJJJ
                (/6([
                        &+$5"/,67O$33(1' I&+5I25'"&+$5JJ
Ahh, much better. Without the A's giving away your rotation value, it's suddenly much harder to decrypt.

Links


About

RotNN.py is Free Software and is released under the terms of the GPL. If you don't know what that means, please follow the link!


Computer Stuff

Adam
Index - Personal - Bleat - Computer - Links

Gurno.com
Adam - Linnea - About Gurno.com