Extension:ROT13

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
ROT13
Release status: stable
ROT13 extension example.png
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 GPL
Download
  • $wgROT13Right
  • $wgROT13Strlen
$wgROT13Strlen
  • encrypt
Translate the ROT13 extension if it is available at translatewiki.net
Check usage and version matrix.

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.

Installation[edit]

  • 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";
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration[edit]

Parameters[edit]

$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 rights[edit]

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;


Usage[edit]

ROT13[edit]

{{#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 ciphers[edit]

{{#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!

See also[edit]

External link[edit]