/// <summary> /// 通过密码得到一个通用Des密钥 /// </summary> /// <param name="passwd">密码</param> /// <returns>返回密钥</returns> public static byte[] GenDesKey(byte[] passwd) { byte[] dg = MD5Util.GetMd5Digest(passwd); return(dg.SubBytes(0, 8)); }
/// <summary> /// 通过密码得到一个通用128位Aes密钥 /// </summary> /// <param name="passwd">密码</param> /// <returns>返回密钥</returns> public static byte[] GenAesKey128(byte[] passwd) { return(MD5Util.GetMd5Digest(passwd)); }