PHP Programing Logic ?

Christian

New member
Function 1
<?php
function cryptone($str){
for($i=0;$i<strlen($str);$i++){
$rotfirst[] = ord(substr($str,$i,1));
}
$keys = str_split(array_sum($rotfirst),2);
// clue : The second function key located on the output index to-2
}
$str = "Dear Selingkuhanku,
Maaf ya kalo pesan ini aku kirim pake cipher. Biar cewekku gak bisa baca pesan rahasia kita ini.
Aku mau ngomong sesuatu deh sama kamu. Tapi gak di fungsi yang ini, tapi difungsi yang satunya lagi. ^_^
";
?>


Function 2
<?php
function getname($int){
$x=NULL; $pilihanku=NULL;
$bin = "0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111";
for($i=0;$i<strlen($int)/2;$i++){
$x .= dechex(bindec(substr($bin,substr($int,$i*2,2),4)));
}
for($i=0;$i<strlen($x)/2;$i++){
$pilihanku .= chr(hexdec(substr($x,$i*2,2)));
}
}
function crypthree($cryptwo){
$initial = (strpos(mcrypt_enc_get_algorithms_name(mcrypt_module_open(MCRYPT_CAST_256, '', MCRYPT_MODE_CFB, '')),
strtoupper($cryptwo))===false)?getname("2500300530153005351030553525"):getname("2070300530203040304535103005");
}
?>

what is the name initials ?? $initial variable

Thank you, Test your logic programing
 
Back
Top