could you tell me what's your mean

解决方案 »

  1.   

    不用转化吧,VS里已经集成有DES算法了,只要调用就OK了,网上有源码,
      

  2.   

    public class Encryption 

    public Encryption() 

    } /// <summary> 
    /// 对字符串进行加密。 
    /// </summary> 
    /// <param name="src">要加密的字符串。 </param> 
    /// <returns>返回加密后的字符串。 </returns> 
    public static string Encrypt(string src) 

    if (src == "") return src; Encoding enc = Encoding.Unicode; 
    byte [] input = enc.GetBytes(src); 
    byte [] output = Encryption.Encrypt(input); string result = System.Convert.ToBase64String(output); 
    return result; 
    } /// <summary> 
    /// 对字节数组进行加密。 
    /// </summary> 
    /// <param name="input">要加密的字节数组。 </param> 
    /// <returns>返回加密后的字节数组。 </returns> 
    public static byte [] Encrypt(byte[] input) 

    byte[] key = {0x13, 0x90, 0x11, 0x99, 0x93, 0x13, 0x80, 0x12}; 
    byte[] iv = {0x08, 0x01, 0x41, 0x39, 0x01, 0x19, 0x99, 0x31}; DESCryptoServiceProvider desp = new DESCryptoServiceProvider(); 
    ICryptoTransform enf = desp.CreateEncryptor(key, iv); byte [] output = enf.TransformFinalBlock(input, 0, input.Length); return output; 
    } /// <summary> 
    /// 对字节数组进行解密。 
    /// </summary> 
    /// <param name="input">要解密的字节数组。 </param> 
    /// <returns>返回解密后的字节数组。 </returns> 
    public static byte [] Decrypt(byte[] input) 

    byte[] key = {0x13, 0x90, 0x11, 0x99, 0x93, 0x13, 0x80, 0x12}; 
    byte[] iv = {0x08, 0x01, 0x41, 0x39, 0x01, 0x19, 0x99, 0x31}; DESCryptoServiceProvider desp = new DESCryptoServiceProvider(); 
    ICryptoTransform enf = desp.CreateDecryptor(key, iv); byte [] output = enf.TransformFinalBlock(input, 0, input.Length); return output; 
    } /// <summary> 
    /// 对字符串进行解密。 
    /// </summary> 
    /// <param name="src">要解密的字符串。 </param> 
    /// <returns>返回解密后的字符串。 </returns> 
    public static string Decrypt(string src) 

    if (src == "") return src; Encoding enc = Encoding.Unicode; byte [] input = System.Convert.FromBase64String(src); 
    byte [] output = Encryption.Decrypt(input); string result = enc.GetString(output); 
    return result; 



      

  3.   

    建议你将这个代码打包成dll,然后在服务器注册这个dll,最后用asp的Server.CreateObject调用。
      

  4.   

    DES算法及其在VC++6.0下的实现源代码http://download.csdn.net/source/334900这个应该可以编译成dll给asp调用