Esempio n. 1
0
     } else {
         $res .= "\n\t\t<br>\n\t\t<div id='error'>[-] String : [" . htmlspecialchars($encrypt_str) . "] \n\t\t<br>\n\t\t&nbsp;|\n\t\t<br>\n\t\t&nbsp;|--> Hash&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : [" . htmlspecialchars($hash) . "]\n\t\t<br>\n\t\t&nbsp;|--> Algorithm : [" . htmlspecialchars($encrypt_algo) . "] \n\t\t<br>\n\t\t&nbsp;|--> Status&nbsp;&nbsp;&nbsp; : [Exist In DB!]\n\t\t</div><br>";
     }
 }
 //################################# End Insert String #################################//
 /*******************************************************************************************/
 //################################# Start Insert File #################################//
 if (isset($_POST['add'])) {
     $encrypt_file = $_POST['encryptfile'];
     $encrypt_file = str_replace("../", "", $encrypt_file);
     $encrypt_algo = $_POST['algo'];
 }
 //open file;
 if (isset($encrypt_file) && isset($encrypt_algo) && is_file($encrypt_file)) {
     //split file;
     $encrypt_file = fsplit($encrypt_file);
     foreach ($encrypt_file as $files) {
         $fo = fopen($files, "r");
         //check handler;
         if ($fo) {
             //read file line by line;
             while (($lines = fgets($fo)) !== false) {
                 //convert string to hash;
                 $lines = trim($lines);
                 $hash = hashAlgorithm($encrypt_algo, $lines);
                 //insert hash into created table;
                 $select = "SELECT * FROM hash WHERE hashes=:hash";
                 $stmt = $connect->prepare($select);
                 $stmt->bindParam(':hash', $hash);
                 $stmt->execute();
                 $check = $stmt->fetchColumn();
Esempio n. 2
0
<?php

include './phpfslit.php';
$parts = fsplit("test.zip", 10000);