Difference between revisions of "Lesson 54--Microduino MD5"

From Microduino Wiki
Jump to: navigation, search
(Created page with "{| style="width: 800px;" |- | ==Purpose== This course will show you the most common MD5(Message Digest Algorithm 5) and explain the correctness of encryption in Microduino. ...")
 
(MD5 Encryption)
 
(2 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
==Purpose==
 
==Purpose==
  
This course will show you the most common MD5(Message Digest Algorithm 5) and explain the correctness of encryption in Microduino. 本教程将介绍如何使用最常用的加密方法MD5加密,并在Microduino中解释加密的正确性。
+
This course will show you the most common MD5(Message Digest Algorithm 5) and explain the correctness of encryption in Microduino.  
  
 
==MD5 Encryption==
 
==MD5 Encryption==
  
''Introduction:'''
+
'''Introduction:'''
  
 
MD5 is a widely-used hash function in the field of computer safety, offering overall protection for information. The file number of the algorithm is RFC 1321. ( R.Rivest,MIT Laboratory for Computer Science and RSA Data Security Inc. April 1992)   
 
MD5 is a widely-used hash function in the field of computer safety, offering overall protection for information. The file number of the algorithm is RFC 1321. ( R.Rivest,MIT Laboratory for Computer Science and RSA Data Security Inc. April 1992)   
Line 20: Line 20:
 
'''Disadvantage:'''
 
'''Disadvantage:'''
  
On August 17th, 2004, Chinese professor Xiaoyun Wang posted the decode of MD5, HAVAL-128, MD4 and RIPEMD algorithm in Crypto’ 2004 in the US, announcing the decoding result of MD series algorithm. (Note: it was not really decode but accelerated hash collisions.)  
+
On August 17th, 2004, Chinese professor Xiaoyun Wang posted the decode of MD5, HAVAL-128, MD4 and RIPEMD algorithm in Crypto' 2004 in the US, announcing the decoding result of MD series algorithm. (Note: it was not really decode but accelerated hash collisions.)
  
 
==Equipment==
 
==Equipment==
*'''[[Microduino-Core/zh]]'''
+
*'''[[Microduino-Core]]'''
*'''[[Microduino-USBTTL/zh]]'''
+
*'''[[Microduino-USBTTL]]'''
  
  
Line 68: Line 68:
 
==Debugging==
 
==Debugging==
  
Step 1: Download the code and run it. If the compile goes wrong, it means you don’t have local library of [[https://github.com/tzikis/ArduinoMD5 ArduinoMD5]]. After download and installation, you should restart IDE.  
+
Step 1: Download the code and run it. If the compile goes wrong, it means you don't have local library of [[https://github.com/tzikis/ArduinoMD5 ArduinoMD5]]. After download and installation, you should restart IDE.  
  
  
Line 78: Line 78:
  
 
Step 3:  
 
Step 3:  
Prove it on [http://md5calculator.chromefans.org md5calculator.chromefans.org].
+
 
 
[[File:MicroduinoMD5_1.jpg|600px|center|thumb]]
 
[[File:MicroduinoMD5_1.jpg|600px|center|thumb]]
  
Line 85: Line 85:
 
==Result==
 
==Result==
  
The text “Hello Microduino” is enciphered by MD5 algorithm, which is very hard to be changed to the previous one.   
+
The text "Hello Microduino" is enciphered by MD5 algorithm, which is very hard to be changed to the previous one.   
  
 
==Video==
 
==Video==
  
 
|}
 
|}

Latest revision as of 09:16, 12 September 2016

Purpose

This course will show you the most common MD5(Message Digest Algorithm 5) and explain the correctness of encryption in Microduino.

MD5 Encryption

Introduction:

MD5 is a widely-used hash function in the field of computer safety, offering overall protection for information. The file number of the algorithm is RFC 1321. ( R.Rivest,MIT Laboratory for Computer Science and RSA Data Security Inc. April 1992)

Here is the brief introduction of MD5: MD5 handles the input information grouped in 512-bit and each group is divided into sixteen 32-bit group. After a series of processing, the output of the algorithm consists of four 32-bit groups which generates a 128-bit hash value after cascading.

Advantage:

Van oorschot and Wiener has considered to find brute-force hash function and they supposed a specially designed MD5 conflict searching machine can find a conflict every 24-day. But from the year of 1991 to 2001, there was no new algorithm that came to replace MD5. From that we can see, MD5 is not influenced in safety. All the defects cannot become the problem of MD5 in practical application. Besides, since MD5 algorithm needs no copyright cost to pay, it can also be treated as an excellent intermediate technology.

Disadvantage:

On August 17th, 2004, Chinese professor Xiaoyun Wang posted the decode of MD5, HAVAL-128, MD4 and RIPEMD algorithm in Crypto' 2004 in the US, announcing the decoding result of MD series algorithm. (Note: it was not really decode but accelerated hash collisions.)

Equipment


  • Other Hardware Equipment
    • USB cable one
    • Breadboard jumpers one box


Program

#include "MD5.h"
/*
This is en example of how to use my MD5 library. It provides two
 easy-to-use methods, one for generating the MD5 hash, and the second
 one to generate the hex encoding of the hash, which is frequently used.
 */
void setup()
{
  //initialize serial
  Serial.begin(9600);
  //give it a second
  delay(1000);
  //generate the MD5 hash for our string
  unsigned char* hash=MD5::make_hash("Hello Microduino");
  //generate the digest (hex encoding) of our hash
  char *md5str = MD5::make_digest(hash, 16);
  //print it on our serial monitor
  Serial.println(md5str);

  char* test="Hello Microduino";
  unsigned char* hash2=MD5::make_hash(test);
  md5str=MD5::make_digest((unsigned char*)hash2, 16);
  Serial.println(md5str);

}

void loop()
{
}

Debugging

Step 1: Download the code and run it. If the compile goes wrong, it means you don't have local library of [ArduinoMD5]. After download and installation, you should restart IDE.


Step 2: Open serial communication and it will show two lines of ciphertext, just as follows:

MicroduinoMD5.jpg

The ciphertext is the text after “Hello Microduino” gets enciphered by MD5.


Step 3:

MicroduinoMD5 1.jpg

The result is consistent with the calculation result of the editor on the online MD5 website.

Result

The text "Hello Microduino" is enciphered by MD5 algorithm, which is very hard to be changed to the previous one.

Video