3 changed files with 132 additions and 1 deletions
@ -0,0 +1,88 @@
|
||||
<?php |
||||
|
||||
namespace App\Libraries; |
||||
|
||||
use Exception; |
||||
|
||||
class AldLibrary |
||||
{ |
||||
//private $fixedKey = session('nip'); |
||||
|
||||
public function generateKey($username) { |
||||
$time = time(); |
||||
$time_mod = $time % 8; // Modulus time with 8 |
||||
|
||||
$fixed_phrase = "fixed_phrase"; // Frase tetap yang elu isi sendiri cuk! |
||||
$key_variations = [ |
||||
"peopleDoCrazyThing", "JumpAround!", "ZarakiKenpachi", "UpOverAndGo!!!", "HeyThere..NiceToMeetY0u", "ToBeOrNotToBe!", "AreYouOkay?..", "paip123!OYEE" |
||||
]; |
||||
$mod_key = $key_variations[$time_mod]; // Kata kunci berdasarkan hasil mod dari time() |
||||
|
||||
// Menghitung jumlah ASCII dari username |
||||
$ascii_sum = 0; |
||||
for ($i = 0; $i < strlen($username); $i++) { |
||||
$ascii_sum += ord($username[$i]); |
||||
} |
||||
|
||||
// Menentukan frase "genap" atau "ganjil" |
||||
$even_odd_phrase = ($ascii_sum % 2 == 0) ? "genap" : "ganjil"; |
||||
|
||||
// Menggabungkan semua kunci |
||||
$final_key = $username . $mod_key . $fixed_phrase . $even_odd_phrase; |
||||
|
||||
// Mengembalikan kunci yang dihasilkan |
||||
return $final_key; |
||||
} |
||||
|
||||
public function encryptMe($str, $username) { |
||||
$hasil = ''; |
||||
$kunci = $this->generateKey($username); |
||||
for ($i = 0; $i < strlen($str); $i++) { |
||||
$karakter = substr($str, $i, 1); |
||||
$kuncikarakter = substr($kunci, ($i % strlen($kunci)), 1); |
||||
$karakter = chr(ord($karakter) + ord($kuncikarakter)); |
||||
$hasil .= $karakter; |
||||
} |
||||
return urlencode(base64_encode($hasil)); |
||||
} |
||||
|
||||
public function decryptMe($str, $username) { |
||||
$str = base64_decode(urldecode($str)); |
||||
$hasil = ''; |
||||
$kunci = $this->generateKey($username); |
||||
for ($i = 0; $i < strlen($str); $i++) { |
||||
$karakter = substr($str, $i, 1); |
||||
$kuncikarakter = substr($kunci, ($i % strlen($kunci)), 1); |
||||
$karakter = chr(ord($karakter) - ord($kuncikarakter)); |
||||
$hasil .= $karakter; |
||||
} |
||||
return $hasil; |
||||
} |
||||
|
||||
public function encryptMeMawas($str) { |
||||
$hasil = ''; |
||||
$salt = "generateFromDMPToMawasSince26082024"; |
||||
$kunci = $this->generateKey($salt); |
||||
for ($i = 0; $i < strlen($str); $i++) { |
||||
$karakter = substr($str, $i, 1); |
||||
$kuncikarakter = substr($kunci, ($i % strlen($kunci)), 1); |
||||
$karakter = chr(ord($karakter) + ord($kuncikarakter)); |
||||
$hasil .= $karakter; |
||||
} |
||||
return urlencode(base64_encode($hasil)); |
||||
} |
||||
|
||||
public function decryptMeMawas($str) { |
||||
$str = base64_decode(urldecode($str)); |
||||
$hasil = ''; |
||||
$salt = "generateFromDMPToMawasSince26082024"; |
||||
$kunci = $this->generateKey($salt); |
||||
for ($i = 0; $i < strlen($str); $i++) { |
||||
$karakter = substr($str, $i, 1); |
||||
$kuncikarakter = substr($kunci, ($i % strlen($kunci)), 1); |
||||
$karakter = chr(ord($karakter) - ord($kuncikarakter)); |
||||
$hasil .= $karakter; |
||||
} |
||||
return $hasil; |
||||
} |
||||
} |
@ -1 +1,44 @@
|
||||
INFO - 2024-09-01 16:46:10 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver. |
||||
INFO - 2024-09-01 16:49:37 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver. |
||||
INFO - 2024-09-01 16:49:37 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver. |
||||
WARNING - 2024-09-01 16:49:51 --> [DEPRECATED] number_format(): Passing null to parameter #1 ($num) of type float is deprecated in APPPATH\Views\kanwil\dashboard.php on line 543. |
||||
1 APPPATH\Views\kanwil\dashboard.php(543): number_format(null, 0, ',', '.') |
||||
2 SYSTEMPATH\View\View.php(228): include('C:\\xampp\\htdocs\\engineN\\app\\Views\\kanwil\\dashboard.php') |
||||
3 SYSTEMPATH\View\View.php(231): CodeIgniter\View\View->CodeIgniter\View\{closure}() |
||||
4 SYSTEMPATH\Common.php(1178): CodeIgniter\View\View->render('kanwil/dashboard', [], true) |
||||
5 APPPATH\Controllers\Kanwil.php(74): view('kanwil/dashboard', [...]) |
||||
6 SYSTEMPATH\CodeIgniter.php(943): App\Controllers\Kanwil->index() |
||||
7 SYSTEMPATH\CodeIgniter.php(503): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Kanwil)) |
||||
8 SYSTEMPATH\CodeIgniter.php(361): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false) |
||||
9 FCPATH\index.php(79): CodeIgniter\CodeIgniter->run() |
||||
WARNING - 2024-09-01 16:49:51 --> [DEPRECATED] number_format(): Passing null to parameter #1 ($num) of type float is deprecated in APPPATH\Views\kanwil\dashboard.php on line 544. |
||||
1 APPPATH\Views\kanwil\dashboard.php(544): number_format(null, 0, ',', '.') |
||||
2 SYSTEMPATH\View\View.php(228): include('C:\\xampp\\htdocs\\engineN\\app\\Views\\kanwil\\dashboard.php') |
||||
3 SYSTEMPATH\View\View.php(231): CodeIgniter\View\View->CodeIgniter\View\{closure}() |
||||
4 SYSTEMPATH\Common.php(1178): CodeIgniter\View\View->render('kanwil/dashboard', [], true) |
||||
5 APPPATH\Controllers\Kanwil.php(74): view('kanwil/dashboard', [...]) |
||||
6 SYSTEMPATH\CodeIgniter.php(943): App\Controllers\Kanwil->index() |
||||
7 SYSTEMPATH\CodeIgniter.php(503): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Kanwil)) |
||||
8 SYSTEMPATH\CodeIgniter.php(361): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false) |
||||
9 FCPATH\index.php(79): CodeIgniter\CodeIgniter->run() |
||||
WARNING - 2024-09-01 16:49:51 --> [DEPRECATED] number_format(): Passing null to parameter #1 ($num) of type float is deprecated in APPPATH\Views\kanwil\dashboard.php on line 549. |
||||
1 APPPATH\Views\kanwil\dashboard.php(549): number_format(null, 0, ',', '.') |
||||
2 SYSTEMPATH\View\View.php(228): include('C:\\xampp\\htdocs\\engineN\\app\\Views\\kanwil\\dashboard.php') |
||||
3 SYSTEMPATH\View\View.php(231): CodeIgniter\View\View->CodeIgniter\View\{closure}() |
||||
4 SYSTEMPATH\Common.php(1178): CodeIgniter\View\View->render('kanwil/dashboard', [], true) |
||||
5 APPPATH\Controllers\Kanwil.php(74): view('kanwil/dashboard', [...]) |
||||
6 SYSTEMPATH\CodeIgniter.php(943): App\Controllers\Kanwil->index() |
||||
7 SYSTEMPATH\CodeIgniter.php(503): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Kanwil)) |
||||
8 SYSTEMPATH\CodeIgniter.php(361): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false) |
||||
9 FCPATH\index.php(79): CodeIgniter\CodeIgniter->run() |
||||
WARNING - 2024-09-01 16:49:51 --> [DEPRECATED] number_format(): Passing null to parameter #1 ($num) of type float is deprecated in APPPATH\Views\kanwil\dashboard.php on line 550. |
||||
1 APPPATH\Views\kanwil\dashboard.php(550): number_format(null, 0, ',', '.') |
||||
2 SYSTEMPATH\View\View.php(228): include('C:\\xampp\\htdocs\\engineN\\app\\Views\\kanwil\\dashboard.php') |
||||
3 SYSTEMPATH\View\View.php(231): CodeIgniter\View\View->CodeIgniter\View\{closure}() |
||||
4 SYSTEMPATH\Common.php(1178): CodeIgniter\View\View->render('kanwil/dashboard', [], true) |
||||
5 APPPATH\Controllers\Kanwil.php(74): view('kanwil/dashboard', [...]) |
||||
6 SYSTEMPATH\CodeIgniter.php(943): App\Controllers\Kanwil->index() |
||||
7 SYSTEMPATH\CodeIgniter.php(503): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Kanwil)) |
||||
8 SYSTEMPATH\CodeIgniter.php(361): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false) |
||||
9 FCPATH\index.php(79): CodeIgniter\CodeIgniter->run() |
||||
INFO - 2024-09-01 16:49:59 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver. |
||||
|
@ -1 +1 @@
|
||||
__ci_last_regenerate|i:1725183970; |
||||
__ci_last_regenerate|i:1725183970;nip|s:9:"060112817";nipp|s:18:"198602112006021005";nama|s:16:"MUHAMMAD ZAMRONI";kppadm|s:3:"100";jabatan|s:9:"Pelaksana";kantor|s:28:"Kanwil DJP Jakarta Selatan I";seksi|s:56:"Bidang Pemeriksaan, Penagihan, Intelijen, dan Penyidikan";tpkantor|s:6:"Kanwil";kwladm|s:3:"100";isLogin|b:1;_ci_previous_url|s:42:"https://localhost/engineN/kewilayahan/kytp"; |
Loading…
Reference in new issue