发布网友
共1个回答
热心网友
156113150128160162115184200141157249149585353
C# 源码
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
namespace ConsoleApplication34
{
class Program
{
static void Main(string[] args)
{
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
byte[] key = new byte[] { 0x13, 0x34, 0x57, 0x79, 0x9b, 0xbc, 0xde, 0xf1 };
byte[] clearText = new byte[] { 0x01, 0x23, 0x45, 0x67, 0x, 0xab, 0xcd, 0xef };
des.Key = key;
byte[] output = des.CreateEncryptor().TransformFinalBlock(clearText, 0, 8);
string fianlString = "";
for (int i = 0; i < output.Length; i++)
{
fianlString += output[i].ToString();
}
Console.Write(fianlString);
Console.Read();
}
}
}