ROT13
Apply "ROT13" Transformation to a File {#rot13-apply-rot13-transformation-to-a-file align="center"}
ROT13 is a C++ program which reads a file and makes a copy in which all characters have been "rotated" by 13 positions, and all digits have been "rotated" by 5 positions.
Applying ROT13 to the transformed file returns the original. Thus, ROT13 can be used as a very simply method of encoding and decoding text files. Only an idiot would be fooled by this encoding, but nonetheless the encoding serves a number of useful purposes. And often, it's only idiots you have to fool, after all.
rot13 file1.txt
where
- file1.txt is the input file to be encoded.
The output filename is the ROT13 transformation of the input filename. In the case of "file1.txt", the output filename would be svyr6.gkg.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
ROT13 is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version and a Python version.
CAESAR, a C++ library which can apply a Caesar Shift Cipher to a string of text.
CR2LF, a C++ program which reads a text file and replaces carriage returns by line feeds.
CRRM, a C++ program which reads a text file and writes a copy which has no carriage returns.
DEBLANK, a C++ program which makes a copy of a text file in which blank lines have been removed.
DECOMMENT, a C++ program which makes a copy of a text file which contains no "comment" lines (that begin with "#").
FILUM, a C++ library which performs various operations on files.
REWORD, a C++ program which makes a copy of a file in which each line has the same number of "words".
UNCONTROL, a C++ program which makes a copy of a text file which contains no control characters.
WRAP, a C++ program which makes a copy of a text file in which long lines have been wrapped.
- rot13.cpp, the source code;
- gettysburg.txt, Lincoln's Gettysburg Address.
- trgglfohet.gkg, the file, encoded by ROT13.
- MAIN is the main program for ROT13.
- CH_TO_ROT13 converts a character to its ROT13 equivalent.
- HANDLE makes a copy of a file after applying ROT13 to it.
- S_TO_ROT13 "rotates" the alphabetical characters in a string by 13 positions.
- TIMESTAMP prints the current YMDHMS date as a time stamp.
You can go up one level to the C++ source codes.
Last revised on 21 May 2011.