前の記事 ≪:PC無しでiPodにダイレクトに録画する
次の記事 ≫:PHP5で書かれたWeb2.0風プロジェクト管理ツール:activeCollab

PHP暗号化ルーチンのサンプル集

2006年07月09日-はてなブックマーク

スポンサード リンク
[PR] 英単語を忘却曲線アプリを使って超効率よく記憶する方法

PHP Passwords and Encryption Snippets - Spellbook - IT mage’s best friend

PHPで各種暗号化を行う方法。
例えば、128bitのMD5化を行うためには次のような関数で実現出来るらしいです。

<?php

function AuthenticMd5($username$password)
{
    
$one $username;$two $password;$thr $one $two;$fou $thr $one;$fiv $fou $one;
    
$six $thr $thr;$sev $one $two $thr $one;
    
$md1 md5$sev $two md5($one $fiv md5($sev strrev$sev))));
    
$md2 md5$md1 md5$one $thr $fou md5$sev $md1)));
    
$md3 md5$md2 md5($md1));
    
$md4 md5$md3 $md1 $md2 md5($sev));
    return 
$md2 $md1$md4 md5($md3 $md2);


?>

他、md5, base64暗号/複合, htpasswdの値生成ルーチンが紹介されてます。

関連サイト
htpasswd用パス作成ツール

関連の記事検索:PHP, セキュリティ, 暗号
スポンサード リンク

By.KJ : 2006年07月09日 12:09 livedoor Readerで購読 Twitterに投稿

間違いの指摘をしていただける方はメール、あるいはTwitter/FBでお願いします(クリック)