Extension:ROT13

MediaWiki extensions manual
ROT13
Release status: unmaintained
Implementation Parser extension
Description Adds parser functions that display content as ROT13- or otherwise substitution cipher-encrypted, except for users with a specified right.
Author(s) Nathan Larson (Leucostictetalk)
Latest version 1.1.0 (2014-04-05)
MediaWiki 1.23+
PHP 5.3+
Database changes No
License GNU General Public License 2.0 or later
Download
  • $wgROT13Right
  • $wgROT13Strlen
$wgROT13Strlen
  • encrypt

The ROT13 extension adds parser functions that display content as ROT13- or otherwise substitution cipher-encrypted, except for users with a specified right. It is probably the most trivially-bypassed security measure known to man. Anyone who clicks "Edit" or uses prop=revisions will be able to view the plaintext. The only purpose this extension serves is to (hopefully) prevent content from being easily found via keyword-reliant search engines or read by users who are so wiki-naive as to not know about the edit screen or the API. Sadly, this is probably about 95 percent of the Internet-using population.

InstallationEdit

  • Download and place the file(s) in a directory called ROT13 in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php :
    require_once "$IP/extensions/ROT13/ROT13.php";
    
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

ConfigurationEdit

ParametersEdit

$wgROT13Right
Set $wgROT13Right to, say, 'encrypt' if you want the __ROT13__ to render the page as ROT13 for anyone without the encrypt right. It defaults to 'encrypt' anyway. For whatever reason, it doesn't seem to want to work if you put the __ROT13__ right at the beginning of the page, so try elsewhere.
$wgROT13Strlen
The length of the string that should be used for the cipher. Defaults to 52 (26 letters/alphabet multiplied by 2 alphabets/string equals 52 letters/string). Must be an even number.

User rightsEdit

The user right "encrypt" is by default set to the "sysop" user group. In case you would like to set it for a new user group:

$wgGroupPermissions['encrypt']['encrypt'] = true;


UsageEdit

ROT13Edit

{{#rot13: ...}}
Parameter Description
1 Right required to view as plaintext
2 Text to translate

Suppose you want only users with the "encrypt" right (assigned to sysops by default) to be able to read your document. Use the following to translate it into ROT13:

{{#rot13: encrypt|MediaWiki is awesome!}}

The result, for those users who don't have the "encrypt" right, will be:

ZrqvnJvxv vf njrfbzr!

You can also use __ROT13__ to render the contents of the whole page as ROT13 to those who lack the right specified in $wgROT13Right ('encrypt' by default).

You can also use Special:Encrypt.

Other substitution ciphersEdit

{{#cipher: ...}}
Parameter Description
1 Right required to view as plaintext
2 Substitution cipher key. The first 26 letters are the regular alphabet (abcdefghijklmnopqrstuvwxyz); the second 26 letters specify what those letters are to translated as (e.g. qwertyuiopasdfghjklzxcvbnm)
3 Text to translate

Suppose you want only users with the encrypt right to be able to read your document. Use the following to translate it into QwertyCode (a substitution cipher featured in the Micro Adventure novel Million Dollar Gamble):

{{#cipher: encrypt|abcdefghijklmnopqrstuvwxyzqwertyuiopasdfghjklzxcvbnm|MediaWiki is awesome!}}

The result, for those users who don't have the encrypt right, will be:

DtroqVoao ol qvtlgdt!

External linkEdit