Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroalbanese authored Dec 13, 2022
1 parent f5de080 commit fcca592
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Examples/aes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
$block=mcrypt_get_block_size('rijndael-128', 'cbc');

$key='abcdefghijuklmno';
$iv='0000000000000000';
$str='hello world!';

//zero to PKCS7 padding
$pad=$block-(strlen($str)%$block);
$str.=str_repeat(chr($pad), $pad);

$s=mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $str, MCRYPT_MODE_CBC, $iv);

echo 'Encrypted: '.base64_encode($s);
?>
3 changes: 3 additions & 0 deletions Examples/hash.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
echo hash('ripemd160', 'The quick brown fox jumped over the lazy dog.');
?>
13 changes: 13 additions & 0 deletions Examples/list.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
echo "Here are our files";
$path = ".";
$dh = opendir($path);
$i=1;
while (($file = readdir($dh)) !== false) {
if($file != "." && $file != ".." && $file != "index.php" && $file != ".htaccess" && $file != "error_log" && $file != "cgi-bin") {
echo "<a href='$path/$file'>$file</a><br />";
$i++;
}
}
closedir($dh);
?>

0 comments on commit fcca592

Please sign in to comment.