Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Author : Lov3rDns
- Title : Encrypted and Decrypted { Caesar }
- tw/video : https://twitter.com/NetDevr/status/748706162405552129
- thanks @r00t3rz for the effort : http://www.exploit4arab.org/exploits/1382
- */
- set_time_limit(0);
- error_reporting(0);
- echo "\n| Words # ";
- $words=trim(fgets(STDIN));
- echo "\n| For Encrypted Enter 1 for Decrypted Enter 2 # ";
- $type=trim(fgets(STDIN));
- if($type == 1) // Encrypted
- {
- echo "\n| What is the key number .. Example : 10 # ";
- $key=trim(fgets(STDIN));
- function check($first){
- $first = strtoupper($first);
- $second = ord($first);
- return ($second > 64 && $second < 91) ? ($second - 64) : false;
- }
- function en0f($str, $add){
- $ar = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); // u can add the letters big
- $strs = '';
- foreach(str_split($str) as $i => $wor)
- {
- $ifn = (check($wor) - 1);
- if( ( $ifn + $add ) > 26 )
- $strs .= $ar[( $ifn + $add ) - 26];
- else
- $strs .= $ar[$ifn+$add];
- }
- return $strs;
- }
- echo "\r\n Encrypted : [ ".en0f($words, +$key)." ]\r\n";
- }elseif($type == 2) // Decrypted
- {
- echo "\n| What is the key number .. Example : 10 # ";
- $key=trim(fgets(STDIN));
- function check($first){
- $first = strtoupper($first);
- $second = ord($first);
- return ($second > 64 && $second < 91) ? ($second - 64) : false;
- }
- function en0f($str, $add){
- $ar = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); // u can add the letters big
- $strs = '';
- foreach( str_split($str) as $i => $wor ) {
- $ifn = (check($wor) - 1);
- if( ( $ifn + $add ) > 26 )
- $strs .= $ar[( $ifn + $add ) - 26];
- else
- $strs .= $ar[$ifn+$add];
- }
- return $strs;
- }
- echo "\r\n Decrypted : [ ".en0f($words, -$key)." ]\r\n";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment