日期:2014-05-20  浏览次数:20672 次

请问以下是何种数据加密方式?----并且用java如何解密
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.IO;

namespace daoru
{
    /// <summary>    
    /// 对称加密算法类    
    /// </summary>    
    public class SymmetricMethod
    {

        private SymmetricAlgorithm mobjCryptoService;
        private string Key;
        private string sTemp;
        /// <summary>    
        /// 对称加密类的构造函数    
        /// </summary>    
        public SymmetricMethod()
        {
            mobjCryptoService = new RijndaelManaged();
            Key = "jjsdfjs3%dkfg&!*asfj@23j23R(sdfweicjaidfsdf|!-2323hikadsjfasdfhjhsdvnxcmvnxnvdjhukho23o";
            sTemp = "hsdkfjasdfj029392@#@$%%$^%^&((ejkjsdfkajsdfkkfdjxcmvcxjk23234kjdsfjg434930kjdjfj";
        }

  

        /// <summary>    
        /// 获得密钥    
        /// </summary>    
        /// <returns>密钥</returns>    
        private byte[] GetLegalKey()
        {
            string sTemp = Key;
            mobjCryptoService.GenerateKey();
            byte[] bytTemp = mobjCryptoService.Key;
            int KeyLength = bytTemp.Length;
            if (sTemp.Length > KeyLength)
                sTemp = sTemp.Substring(0, KeyLength);
            else if (sTemp.Length < KeyLength)
                sTemp = sTemp.PadRight(KeyLength, ' ');
            return ASCIIEncoding.ASCII.GetBytes(sTemp);
        }
        /// <summary>    
        /// 获得初始向量IV    
        /// </summary>    
        /// <returns>初试向量IV</returns>