X



配布スクリプトの読めない部分を解説しちゃる
0001nobodyさん垢版04/09/11 04:02:39ID:flbBPOWm
Perl、PHPなんでもござれ。
配布スクリプトの中でよくわからん構文などがあったら解読&解説しちゃる。
0070nobodyさん垢版2006/04/28(金) 21:39:59ID:Na6jyHe3
このスクリプトの説明をお願いします。

function ssl_encrypt($source,$type,$key){
//Assumes 1024 bit key and encrypts in chunks.

$maxlength=117;
$output='';
while($source){
$input= substr($source,0,$maxlength);
$source=substr($source,$maxlength);
if($type=='private'){
$ok= openssl_private_encrypt($input,$encrypted,$key);
}else{
$ok= openssl_public_encrypt($input,$encrypted,$key);
}

$output.=$encrypted;
}
return $output;
}

0071nobodyさん垢版2006/04/28(金) 21:41:13ID:Na6jyHe3
続き

function ssl_decrypt($source,$type,$key){
// The raw PHP decryption functions appear to work
// on 128 Byte chunks. So this decrypts long text
// encrypted with ssl_encrypt().

$maxlength=128;
$output='';
while($source){
$input= substr($source,0,$maxlength);
$source=substr($source,$maxlength);
if($type=='private'){
$ok= openssl_private_decrypt($input,$out,$key);
}else{
$ok= openssl_public_decrypt($input,$out,$key);
}

$output.=$out;
}
return $output;

}
レスを投稿する


ニューススポーツなんでも実況