Technopedia Center
PMB University Brochure
Faculty of Engineering and Computer Science
S1 Informatics S1 Information Systems S1 Information Technology S1 Computer Engineering S1 Electrical Engineering S1 Civil Engineering

faculty of Economics and Business
S1 Management S1 Accountancy

Faculty of Letters and Educational Sciences
S1 English literature S1 English language education S1 Mathematics education S1 Sports Education
  • Registerasi
  • Brosur UTI
  • Kip Scholarship Information
  • Performance
  1. Weltenzyklopädie
  2. APR1 — Wikipédia
APR1 — Wikipédia 👆 Click Here! Read More..
Un article de Wikipédia, l'encyclopédie libre.

Cet article est une ébauche concernant l’informatique.

Vous pouvez partager vos connaissances en l’améliorant (comment ?) selon les recommandations des projets correspondants.

APR-1 est une fonction de hashage utilisé par les serveurs Apache pour chiffrer les mots de passe .htaccess. Il se sert de MD5 comme base.

Le résultat est structuré comme suit :

$apr1$__SALT__$_________HASH_________

Le sel fait 8 caractères et le hash 22.

Algorithme

[modifier | modifier le code]
Code PHP
function apr1_salt()
{
	$saltern = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/.';
	$salt = '';
	for ($i=0; $i<8; $i++)
	{
		$salt .= $saltern[rand(0, 64)];
	}
	return $salt;
}
function apr1($mdp, $salt)
{
	$max = strlen($mdp);
	$context = $mdp.'$apr1$'.$salt;
	$binary = pack('H32', md5($mdp.$salt.$mdp));
	for ($i=$max; $i>0; $i-=16)
	{
		$context .= substr($binary, 0, min(16, $i));
	}
	for ($i=$max; $i>0; $i>>=1)
	{
		$context .= ($i & 1) ? chr(0) : $mdp{0};
	}
	$binary = pack('H32', md5($context));
	for ($i=0; $i<1000; $i++)
	{
		$new = ($i & 1) ? $mdp : $binary;
		if ($i % 3)
		{
			$new .= $salt;
		}
		if ($i % 7)
		{
			$new .= $mdp;
		}
		$new .= ($i & 1) ? $binary : $mdp;
		$binary = pack('H32', md5($new));
	}
	$hash = '';
	for ($i = 0; $i < 5; $i++)
	{
		$k = $i+6;
		$j = $i+12;
		if($j == 16) $j = 5;
		$hash = $binary{$i}.$binary{$k}.$binary{$j}.$hash;
	}
	$hash = chr(0).chr(0).$binary{11}.$hash;
	$hash = strtr(
		strrev(substr(base64_encode($hash), 2)),
		'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
		'./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
	);
	return '$apr1$'.$salt.'$'.$hash;
}
 
v · m
Fonctions de hachage cryptographiques
Algorithmes
  • APR1
  • AR
  • Bcrypt
  • Boognish
  • FFT-hash
  • HAS-160
  • Haval
  • MD2
  • MD4
  • MD5
  • MD6
  • N-hash
  • PANAMA
  • RadioGatún
  • RIPEMD
  • RIPEMD-128
  • RIPEMD-160
  • RIPEMD-256
  • Scrypt
  • SHA-0
  • SHA-1
  • SHA-2
    • SHA-224
    • SHA-256
    • SHA-384
    • SHA-512
  • SHA-3
  • Snefru
  • StepRightUp
  • Streebog
  • Tiger
  • VSH
  • Whirlpool
Cryptanalyse
  • Attaque des anniversaires
  • Paradoxe des anniversaires
  • Linéaire
  • Différentielle
  • Attaque par force brute
  • Effet avalanche
  • Pseudo-collision
  • Attaque de collisions
  • Attaque de préimage
  • Attaque par extension de longueur
Architecture
  • Remplissage
  • Fonction de compression
  • Construction de Merkle-Damgård
  • Construction de Miyaguchi-Preneel
  • Construction de Matyas-Meyer-Oseas
  • Construction de Davies-Meyer
  • Construction de l'éponge
  • icône décorative Portail de la cryptologie
Ce document provient de « https://fr.teknopedia.teknokrat.ac.id/w/index.php?title=APR1&oldid=149945628 ».
Catégorie :
  • Algorithme de hachage
Catégories cachées :
  • Wikipédia:ébauche informatique
  • Portail:Cryptologie/Articles liés
  • Portail:Informatique/Articles liés

  • indonesia
  • Polski
  • الرية
  • Deutsch
  • English
  • Español
  • Français
  • Italiano
  • مصر
  • Nederlands
  • 本語
  • Português
  • Sinugboanong Binisaya
  • Svenska
  • Українска
  • Tiếng Việt
  • Winaray
  • 中文
  • Русски
Sunting pranala
Pusat Layanan

UNIVERSITAS TEKNOKRAT INDONESIA | ASEAN's Best Private University
Jl. ZA. Pagar Alam No.9 -11, Labuhan Ratu, Kec. Kedaton, Kota Bandar Lampung, Lampung 35132
Phone: (0721) 702022
Email: pmb@teknokrat.ac.id