Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- #######################################
- # notepads uber 1337 encryption codez #
- #######################################
- $text = 'A secret.';
- if(!isset($chars))
- {
- // 3 different symbols (or combinations) for obfuscation
- // these should not appear within the original text
- $sym = array('¶', '¥xQ', '|');
- foreach(range('a','z') as $key=>$val)
- $chars[$val] = str_repeat($sym[0],($key + 1)).$sym[1];
- $chars[' '] = $sym[2];
- unset($sym);
- }
- // encrypt
- function encrypt($data)
- {
- $data = strtr(strtolower($data), $GLOBALS['chars']);
- return $data;
- }
- // decrypt
- function decrypt($data)
- {
- $charset = array_flip($GLOBALS['chars']);
- $charset = array_reverse($charset, true);
- $data = strtr($data, $charset);
- unset($charset);
- return $data;
- }
- $text = encrypt($text);
- echo 'encrypted: '.$text.'<br />';
- // echo 'decrypted: '.decrypt($text);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement