Exemplo n.º 1
0
 /// <summary>
 /// 构造函数 密钥输入为字符串,偏移向量输入为字符串
 /// </summary>
 /// <param name="bytesKey">密钥</param>
 /// <param name="bytesIV">偏移向量</param>
 /// <param name="plainType">明文类型</param>
 /// /// <param name="EncodingType">编码类型</param>
 public DES(string strKey, string strIV, Encoding encodingType)
 {
     EncodingType = encodingType;
     Key          = EncodingType.GetBytes(Commen.StdLen(strKey, 8));
     IV           = EncodingType.GetBytes(Commen.StdLen(strIV, 8));
 }
Exemplo n.º 2
0
        /// <summary>
        /// 构造函数 密钥输入为字符串,偏移向量输入为比特流 编码类型默认
        /// </summary>
        /// <param name="bytesKey">密钥</param>
        /// <param name="bytesIV">偏移向量</param>

        public DES(string strKey, byte[] bytesIV)
        {
            Key = EncodingType.GetBytes(Commen.StdLen(strKey, 8));
            IV  = bytesIV;
        }
Exemplo n.º 3
0
 /// <summary>
 /// 构造函数 密钥输入为字符串,偏移向量输入为字符串 编码类型默认
 /// </summary>
 /// <param name="bytesKey">密钥</param>
 /// <param name="bytesIV">偏移向量</param>
 public DES(string strKey, string strIV)
 {
     Key = EncodingType.GetBytes(Commen.StdLen(strKey, 8));
     IV  = EncodingType.GetBytes(Commen.StdLen(strIV, 8));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 构造函数 密钥输入为字符串,偏移向量输入为比特流
 /// </summary>
 /// <param name="bytesKey">密钥</param>
 /// <param name="bytesIV">偏移向量</param>
 /// <param name="EncodingType">编码类型</param>
 public AES(string strKey, byte[] bytesIV, Encoding encodingType)
 {
     EncodingType = encodingType;
     Key          = EncodingType.GetBytes(Commen.StdLen(strKey, 16));
     IV           = bytesIV;
 }