| |

VerySource

 Forgot password?
 Register
Search
View: 815|Reply: 7

Difference between md5 ordinary encryption and md5 password encryption

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-8 22:00:02
| Show all posts |Read mode
What is the difference between ordinary encryption and password encryption used in the following, and where are they suitable for use?


<% @ Page Language = "C #" ContentType = "text / html"%>
<% @ Import Namespace = "System"%>
<script language = "C #" runat = "server">
void Page_Load (Object sender, EventArgs e) {
// Get the field to be encrypted and convert it into a Byte [] array
byte [] data = System.Text.Encoding.Unicode
.GetBytes (source.Text.ToCharArray ());
// Establish encryption service
System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider ();
// Encrypt Byte [] array
byte [] result = md5.ComputeHash (data);
// Convert the encrypted array into a field
string sResult = System.Text.Encoding.Unicode.GetString (result);
//show
sha1_1.Text = "MD5 ordinary encryption:" + sResult.ToString () + "<br/>";
// Encrypt as password
string EnPswdStr = System.Web.Security.FormsAuthentication.
HashPasswordForStoringInConfigFile (source.Text.ToString (), "MD5");
//show
sha1_2.Text = "MD5 password encryption:" + EnPswdStr + "<br/>";
}
</ script>
<html>
<head>
<meta http-equiv = "Content-Type" content = "text / html; charset = gb2312">
<title> Test </ title>
</ head>
<body>
<h3> SHA1 encryption </ h3>
<form runat = "server">
<asp: label id = "sha1_1" runat = "server"> </ asp: label>
<asp: label id = "sha1_2" runat = "server"> </ asp: label>
<asp: textbox ID = "source" runat = "server" TextMode = "SingleLine" Text = "test" AutoPostBack = "true" />
(Enter)
</ form>
</ body>
</ html>
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-10 17:09:01
| Show all posts
up
Reply

Use magic Report

0

Threads

64

Posts

35.00

Credits

Newbie

Rank: 1

Credits
35.00

 China

Post time: 2020-1-11 09:27:01
| Show all posts
The reason you ask this question, like many people, is never to find out how to "decrypt" yourself.
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-1-17 15:09:01
| Show all posts
I'm not looking for a way to "decrypt" but I want to know which kind of encryption is more secure
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-17 22:18:02
| Show all posts
@never8023
You don't need to know too much, just know that MD5 is irreversible.
Reply

Use magic Report

0

Threads

29

Posts

19.00

Credits

Newbie

Rank: 1

Credits
19.00

 China

Post time: 2020-1-18 19:09:01
| Show all posts
Both sha1 and md5 are okay. 128-bit encryption is highly secure and irreversible. Although some people now have cramps and say that 5 years can calculate a crash. Khan--b
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-20 21:27:01
| Show all posts
md5 encryption is irreversible
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-21 18:54:01
| Show all posts
Learn
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list