Extension:Crypto
![]() |
If you need per-page or partial page access restrictions, you are advised to install an appropriate content management package. MediaWiki was not written to provide per-page access restrictions, and almost all hacks or patches promising to add them will likely have flaws somewhere, which could lead to exposure of confidential data. We are not responsible for anything being leaked, leading to loss of funds or one's job. For further details, see Security issues with authorization extensions |
![]() |
WARNING: the code or configuration described here poses a major security risk. Problem: This uses an insecure method of encrypting stuff. It does not provide any non-superficial security. |
![]() |
This extension stores its code inside a wiki page. Please be aware that MediaWiki developers do not review or keep track of extensions that put their code on the wiki.
|
Crypto Release status: stable |
|||
---|---|---|---|
Implementation | Parser functions | ||
Description | Displays encrypted data based upon group membership | ||
Author(s) | Ryan O. Stouffer (GoodyMasTalk) | ||
Last version | 1.0 (0) | ||
MediaWiki | 1.11.2 | ||
License | GPL | ||
Download | Extension:Crypto/Version_1.0#Code | ||
|
|||
|
|||
Check usage (experimental) |
Contents |
[edit] What can this extension do?
Encrypts portions of text inside a wiki page. For use when you want to add things like passwords and only have them viewable by people of a certain group.
[edit] Usage
After configuring a group with an encryption key you can add the following Parser Function to any wiki page as long as you are a member of the group. The function works by supplying 3 parameters. The first is the group name the person viewing the page has to have to decrypt the text. The second is either the text to be encrypted or the already encrypted text. The third is the optional text to display when the viewer is not a member of a proper group. Default is blank. To encrypt text during the edit place it inside <encrypt></encrypt> tags. During the save process the text will be encrypted with the proper key.
For example:
{{#crypto: user | <encrypt>This is xor encrypted</encrypt> | You do not have permission to view this }}
After saving subsequent edits or view sources will only display:
{{#crypto: user | NgkKHE5JH08OCgBCBA0MHFkcGxMB | You do not have permission to view this }}
The pass phrases you encrypt with are held in LocalSettings.php so make sure you have proper permissions set to restrict read access. The encryption scheme is a simple XOR encryption and you should understand the frailties of this type of encryption scheme before using this extension. Also understand that this is experimental and I take no responsibility for this code not working as designed. In other words, use at your own risk.
[edit] Download instructions
Please cut and paste the code found Version_1.0 and place it in $IP/extensions/Crypto/Crypto.php
. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.
[edit] Installation
To install this extension, add the following to LocalSettings.php:
# add encryption key for group user $cryptoGroupMap['user'] = 'REPLACE WITH RANDOM TEXT'; require_once("$IP/extensions/Crypto/Crypto.php");
[edit] Configuration parameters
The crypto map is defined with a key which represents the group name and the value which represents the phrase to encrypt with. The value you supply should be kept secret and the LocalSettings.php should have the proper permissions set to keep out prying eyes.
[edit] User rights
Dependant upon configuration user rights are varied.