Skip to content

Instantly share code, notes, and snippets.

@avraampiperidis
Created June 18, 2013 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avraampiperidis/5808835 to your computer and use it in GitHub Desktop.
Save avraampiperidis/5808835 to your computer and use it in GitHub Desktop.
a base64 encode cli script
<?php
$who = exec('whoami');
echo ' |--------welcome to Protectsoft---------|'."$who"."\n";
fwrite(STDOUT, "enter your passphrase: "); //STDOUT basic input write method
$input = trim(fgets(STDIN)); //trim removes string spaces at beggining andend,fgets get first line to read,STDIN read input from STDOUT
base64_encode($input); //basic encode function
$str = $input;
base64_decode($str);
echo 'your encoded passphrase is: ',base64_encode($input)."\n";
echo ' |--------Protectron Protectsoft---------|';
echo "\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment