| |

VerySource

 Forgot password?
 Register
Search
Author: chanel1115

Urgent: Question about DES encryption and decryption.

[Copy link]

1

Threads

7

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-1-5 18:30:01
| Show all posts
string text1 = "abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ0123456789` ~! @ # $% ^&* () _ + |-= [] {}; ': <>?,. /";
                        string text2 = text1.Substring (0x36, 1) + text1.Substring (0x44, 1) + text1.Substring (1, 1) + text1.Substring (0x56, 1) + text1.Substring (0x39, 1) + text1. Substring (0x31, 1) + text1.Substring (0x3b, 1) + text1.Substring (0x47, 1);
                        string text3 = _Default.Decrypt (SifuData.UserDn (), text2);
                        string text4 = _Default.Decrypt ("48FC50F3F5EB1A4B9CF9FA16765A4812", text2);
                        string text5 = _Default.Decrypt ("24D673EB0598C4C8CD7A07F2B31E321B", text2);
                        string text6 = base.Request.Url.AbsoluteUri.ToLower ();

This one is similar to what was written upstairs.
"abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ0123456789` ~! @ # $% ^&* () _ + |-= [] {}; ': <>?,. /"
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 United States

Post time: 2020-8-7 20:15:01
| Show all posts
Your idea is correct, but you need to change it slightly

public static string Encryptor(string pToEncryptor, string sKey)
{
DESCryptoServiceProvider provider1 = new DESCryptoServiceProvider();

byte[] buffer1 = ASCIIEncoding.Default.GetBytes(pToEncryptor);

provider1.Key = Encoding.ASCII.GetBytes(sKey);
provider1.IV = Encoding.ASCII.GetBytes(sKey);
MemoryStream stream1 = new MemoryStream();
CryptoStream stream2 = new CryptoStream(stream1, provider1.CreateEncryptor(), CryptoStreamMode.Write);
stream2.Write(buffer1, 0, buffer1.Length);
stream2.FlushFinalBlock();
StringBuilder builder1 = new StringBuilder();
byte[] buffer2 =stream1.ToArray();
for(int i=0;i<buffer2.Length;i++)
{
builder1.Append(buffer2[i].ToString("X"));
}
return builder1.ToString();
}
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-21 21:45:01
| Show all posts
The code upstairs is now changed to a place,
builder1.Append(buffer2[i].ToString("X"));
To
builder1.Append(buffer2[i].ToString("X2"));

Test to achieve the requirements of the landlord
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-21 22:00:01
| Show all posts
Data encryption class library and instance download

Description: Data encryption class library and examples, can perform triplees encryption on strings, streams, and files, and can also generate md5 ciphertext
Development language: C#
Open tool version: vs2005
Main knowledge points: mastery of tripledes encryption related methods
Developer: codestudy
Contact: www.codestudy.cn
download link:
http://www.codestudy.cn/showtopic-4.aspx
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