Documente Academic
Documente Profesional
Documente Cultură
TECHNIQUE
BY
JATIN KUMAR (18BCB0072)
MRIYANK KUMAR SINGH (18BCE0248)
PRABHAKAR KUMAR (18BCE0194)
SLOT – B1
ABSTRACT
MD5 or Message-Digest algorithm 5 is a type of cryptographic hash function that is
generally used together with a 128-bithash value. It is commonly expressed as 32-
digit hexadecimal number. The Message-Digest (MD) algorithm 5 Professor was
created and developed by Ronald L. Rivest from MIT, which is the third version of
Message Digest (The previous encryptions of this category were the MD2 and MD4)
and quite similar to MD5 with respect to structure.
Rivest produced this product for the purpose of using MD5 with digital signature
applications. A Digital signature program includes compression of large-sized files
using safest method possible before it undergoes encryption using a password, which
is under a public key cryptosystem. Today, MD5 algorithm is widely used in the
process of assessing the authenticity of certain files. The procedure of verification
occurs in such a way that a 128-bit-message-digest of any length is formed based on
a primary data input. This is considered to be exclusive to just a single data and it
acts as an individual fingerprint as well. MD5 has been widely used in the software
world to provide some assurance that a transferred file has arrived. But now days, it
is quite easy to generate MD5 collisions, and so far, it is possible for the person who
created the file to create a second file with the same checksum, so the file can be
protected against some forms of malicious tampering.
INTRODUCTION
MD5 encryption is always mentioned when we discuss over the topic of
Cryptography. Message-Digest algorithm 5, more commonly known as MD5, is a
type of cryptographic hash function that is generally used together with a 128- bit
hash value. MD5 is greatly utilized in different security functions as identified in the
standard Internet Engineering Task Force (IETF). According to the experts, MD5
hash is commonly expressed as 32-digit Hexadecimal number. MD5 is somewhat
slower than that of MD4 algorithm, but is more securely and conservatively
designed.
History of MD5
MD5 is an algorithm developed by Professor Ronald Rivest of MIT University in
the series of Message-Digest Algorithms. When statistics and analytics indicated
that the predecessor of MD5, i.e. MD4 algorithm is quite insecure and vulnerable,
MD5 was designed in 1991to be more securable and conservative replacement
against attacks. In 1993, Dan Boer and Bosselaers were succeeded partially in
finding that two different initialization vectors produce an identical digest.In 1996,
Dobbertin announced a collision of compression functionof MD5 algorithm. This
was actually not an attack over thewhole MD5 function but it suggested considering
any better cryptographic replacement for use.
Hash function
A hash function is any well-defined function which converts large amount of data
into a small data representation.
The Hash Function returns a calculated value known as hash values, hash codes,
hash sums, checksums or hashes.
Hash functions are most commonly used for searching the data or for tasks like
comparison, finding items in large databases, detecting similar or duplicate records
in large files, etc. Hash functions are also used in hash tables to quickly locate the
data, used to build cache for large data.
Algorithm
G(B,C,D)=(B∧D)∨(C∧¬D)
H(B,C,D)=B⊕C⊕D
I(B,C,D)=C⊕(B∨¬D)
Figure 1 One MD5 operation. MD5 consists of 64 of these operations, grouped in four rounds of 16 operations. F is a nonlinear
function; one function is used in each round. Mi denotes a 32-bit block of the message input, and Ki denotes a 32-bit constant,
different
$txt = "0123456789";
$show = 15;
$try = $ch1.$ch2.$ch3.$ch4;
if ( $show > 0 ) {
print "$check $try\n";
$show = $show - 1;
}
}
}
}
}
$time_post = microtime(true);
print "Elapsed time: ";
print $time_post-$time_pre;
print "\n";
}
?>
</pre>
Makecode.php
<?php
$error = false;
$md5 = false;
$code = "";
if ( isset($_GET['code']) ) {
$code = $_GET['code'];
if ( strlen($code) !=4 ) {
$error = "Input must be exactly 4 digits PIN";
} else if ( $code[0] < "0" || $code[0] > "9" ||
$code[1] < "0" || $code[1] > "9"
|| $code[2] <"0" || $code[2] > "9" ||
$code[3] < "0" || $code[3] > "9") {
$error = "Input must contains digits";
} else {
$md5 = hash('md5', $code);
}
}
?>
<!DOCTYPE html>
<head><title>vit</title></head>
<body>
<h1>MD5 PIN Maker</h1>
<?php
if ( $error !== false ) {
print '<p style="color:red">';
print htmlentities($error);
print "</p>\n";
}
if ( $md5 !== false ) {
print "<p>MD5 value: ".htmlentities($md5)."</p>";
}
?>
<p>Please enter 4 digit PIN.</p>
<form>
<input type="number" name="code" value="<?= htmlentities($code) ?>"/>
<input type="submit" value="Compute MD5 for CODE"/>
</form>
<p><a href="makecode.php">Reset</a></p>
<p><a href="index.php">Back to Cracking</a></p>
</body>
</html>
Md5.php
<?php
$md5 = "Not computed";
if ( isset($_GET['encode']) ) {
$md5 = hash('md5', $_GET['encode']);
}
?>
<!DOCTYPE html>
<head><title>vit MD5</title></head>
<body>
<h1>MD5 Maker</h1>
<p>MD5: <?= htmlentities($md5); ?></p>
<form>
<input type="text" name="encode" size="40" />
<input type="submit" value="Compute MD5"/>
</form>
<p><a href="md5.php">Reset</a></p>
<p><a href="index.php">Back to Cracking</a></p>
</body>
</html>
Demonstration
References
[1]. “MD5 Algorithm” http://en.wikipedia.org/wiki/MD5
[2]. “The purpose of Cryptography”
http://www.garykessler.net/library/crypto.html#purpose
[3] “MD5, Message-Digest Algorithm”
http://www.networksorcery.com/enp/data/md5.htm
[4]. “RFC 1321 -The MD5 Message-Digest Algorithm”
http://www.faqs.org/rfcs/rfc1321.htm
[5]. “php md5 function”
https://www.php.net/manual/en/function.md5.php