C#实现RSA加密与解密、签名与认证
一、RSA简介
RSA公钥加密算法是1977年由Ron Rivest、Adi Shamirh和LenAdleman在(美国麻省理工学院)开发的。RSA取名来自开发他们三者的名字。RSA是目前最有影响力的公钥加密算法,它能够抵抗到目前为止已知的所有密码攻击,已被ISO推荐为公钥数据加密标准。RSA算法基于一个十分简单的数论事实:将两个大素数相乘十分容易,但那时想要对其乘积进行因式分解却极其困难,因此可以将乘积公开作为加密密钥。RSA算法是第一个能同时用于加密和数字签名的算法,也易于理解和操作。
RSA是被研究得最广泛的公钥算法,从提出到现在已近二十年,经历了各种攻击的考验,逐渐为人们接受,普遍认为是目前最优秀的公钥方案之一。RSA的安全性依赖于大数的因子分解,但并没有从理论上证明破译RSA的难度与大数分解难度等价。即RSA的重大缺陷是无法从理论上把握它的保密性能如何,而且密码学界多数人士倾向于因子分解不是NPC问题。
RSA的缺点主要有:
A)产生密钥很麻烦,受到素数产生技术的限制,因而难以做到一次一密。
B)分组长度太大,为保证安全性,n 至少也要 600bits以上,使运算代价很高,尤其是速度较慢,较对称密码算法慢几个数量级;且随着大数分解技术的发展,这个长度还在增加,不利于数据格式的标准化。目前,SET(Secure Electronic Transaction)协议中要求CA采用2048bits长的密钥,其他实体使用1024比特的密钥。
C)RSA密钥长度随着保密级别提高,增加很快。下表列出了对同一安全级别所对应的密钥长度。
这种算法1978年就出现了,它是第一个既能用于数据加密也能用于数字签名的算法。它易于理解和操作,也很流行。算法的名字以发明者的名字命名:Ron Rivest,
AdiShamir 和Leonard Adleman。早在1973年,英国国家通信总局的数学家Clifford Cocks就发现了类似的算法。但是他的发现被列为绝密,直到1998年才公诸于世。
RSA算法是一种非对称密码算法,所谓非对称,就是指该算法需要一对密钥,使用其中一个加密,则需要用另一个才能解密。
RSA的算法涉及三个参数,n、e1、e2。
其中,n是两个大质数p、q的积,n的二进制表示时所占用的位数,就是所谓的密钥长度。
e1和e2是一对相关的值,e1可以任意取,但要求e1与(p-1)*(q-1)互质;再选择e2,要求(e2*e1)mod((p-1)*(q-1))=1。
(n及e1),(n及e2)就是密钥对。
RSA加解密的算法完全相同,设A为明文,B为密文,则:A=B^e1 mod n;B=A^e2 mod n;
e1和e2可以互换使用,即:
A=B^e2 mod n;B=A^e1 mod n;
二、MD5加密介绍
参考:http://blog.csdn.net/wonsoft/article/details/5913572
MD5的全称是message-digest algorithm 5(信息-摘要算法,在90年代初由mit laboratory for computer science和rsa data security inc的ronald l. rivest开发出来, 经md2、md3和md4发展而来。
MD5具有很好的安全性(因为它具有不可逆的特征,加过密的密文经过解密后和加密前的东东相同的可能性极小)
- public string GetStrMd5(string ConvertString)
- {
- string strBodyBase64 = Convert.ToBase64String(Encoding.UTF8.GetBytes(ConvertString));
- string t2=System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(strBodyBase64, "MD5").ToUpper();
- return t2;
- }
三、C#对PKCS#8编码的RSA私钥进行签名
- /// <summary>
- /// 对MD5加密后的长度为32的密文进行签名
- /// </summary>
- /// <param name="strPrivateKey">私钥</param>
- /// <param name="strContent">MD5加密后的密文</param>
- /// <returns></returns>
- public string SignatureFormatter(string strPrivateKey, string strContent)
- {
- byte[] btContent = Encoding.UTF8.GetBytes(strContent);
- byte[] hv = MD5.Create().ComputeHash(btContent);
- RSACryptoServiceProvider rsp = new RSACryptoServiceProvider();
- rsp.FromXmlString(strPrivateKey);
- RSAPKCS1SignatureFormatter rf = new RSAPKCS1SignatureFormatter(rsp);
- rf.SetHashAlgorithm("MD5");
- byte[] signature = rf.CreateSignature(hv);
- return Convert.ToBase64String(signature);
- }
四、C#实现RSA加密与解密、签名与认证常用方法
1.RSA加密解密:
(1)获取密钥,这里是产生密钥,实际应用中可以从各种存储介质上读取密钥 (2)加密 (3)解密
2.RSA签名和验证
(1)获取密钥,这里是产生密钥,实际应用中可以从各种存储介质上读取密钥 (2)获取待签名的Hash码 (3)获取签名的字符串 (4)验证
3.公钥与私钥的理解:
(1)私钥用来进行解密和签名,是给自己用的。
(2)公钥由本人公开,用于加密和验证签名,是给别人用的。
(3)当该用户发送文件时,用私钥签名,别人用他给的公钥验证签名,可以保证该信息是由他发送的。当该用户接受文件时,别人用他的公钥加密,他用私钥解密,可以保证该信息只能由他接收到。
- using System.Security.Cryptography;
- class RSACryption
- {
- #region RSA 加密解密
- #region RSA 的密钥产生
- /// <summary>
- /// RSA产生密钥
- /// </summary>
- /// <param name="xmlKeys">私钥</param>
- /// <param name="xmlPublicKey">公钥</param>
- public void RSAKey(out string xmlKeys, out string xmlPublicKey)
- {
- try
- {
- System.Security.Cryptography.RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
- xmlKeys = rsa.ToXmlString(true);
- xmlPublicKey = rsa.ToXmlString(false);
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- #endregion
- #region RSA加密函数
- //##############################################################################
- //RSA 方式加密
- //KEY必须是XML的形式,返回的是字符串
- //该加密方式有长度限制的!
- //##############################################################################
- /// <summary>
- /// RSA的加密函数
- /// </summary>
- /// <param name="xmlPublicKey">公钥</param>
- /// <param name="encryptString">待加密的字符串</param>
- /// <returns></returns>
- public string RSAEncrypt(string xmlPublicKey, string encryptString)
- {
- try
- {
- byte[] PlainTextBArray;
- byte[] CypherTextBArray;
- string Result;
- System.Security.Cryptography.RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
- rsa.FromXmlString(xmlPublicKey);
- PlainTextBArray = (new UnicodeEncoding()).GetBytes(encryptString);
- CypherTextBArray = rsa.Encrypt(PlainTextBArray, false);
- Result = Convert.ToBase64String(CypherTextBArray);
- return Result;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// RSA的加密函数
- /// </summary>
- /// <param name="xmlPublicKey">公钥</param>
- /// <param name="EncryptString">待加密的字节数组</param>
- /// <returns></returns>
- public string RSAEncrypt(string xmlPublicKey, byte[] EncryptString)
- {
- try
- {
- byte[] CypherTextBArray;
- string Result;
- System.Security.Cryptography.RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
- rsa.FromXmlString(xmlPublicKey);
- CypherTextBArray = rsa.Encrypt(EncryptString, false);
- Result = Convert.ToBase64String(CypherTextBArray);
- return Result;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- #endregion
- #region RSA的解密函数
- /// <summary>
- /// RSA的解密函数
- /// </summary>
- /// <param name="xmlPrivateKey">私钥</param>
- /// <param name="decryptString">待解密的字符串</param>
- /// <returns></returns>
- public string RSADecrypt(string xmlPrivateKey, string decryptString)
- {
- try
- {
- byte[] PlainTextBArray;
- byte[] DypherTextBArray;
- string Result;
- System.Security.Cryptography.RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
- rsa.FromXmlString(xmlPrivateKey);
- PlainTextBArray = Convert.FromBase64String(decryptString);
- DypherTextBArray = rsa.Decrypt(PlainTextBArray, false);
- Result = (new UnicodeEncoding()).GetString(DypherTextBArray);
- return Result;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// RSA的解密函数
- /// </summary>
- /// <param name="xmlPrivateKey">私钥</param>
- /// <param name="DecryptString">待解密的字节数组</param>
- /// <returns></returns>
- public string RSADecrypt(string xmlPrivateKey, byte[] DecryptString)
- {
- try
- {
- byte[] DypherTextBArray;
- string Result;
- System.Security.Cryptography.RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
- rsa.FromXmlString(xmlPrivateKey);
- DypherTextBArray = rsa.Decrypt(DecryptString, false);
- Result = (new UnicodeEncoding()).GetString(DypherTextBArray);
- return Result;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- #endregion
- #endregion
- #region RSA数字签名
- #region 获取Hash描述表
- /// <summary>
- /// 获取Hash描述表
- /// </summary>
- /// <param name="strSource">待签名的字符串</param>
- /// <param name="HashData">Hash描述</param>
- /// <returns></returns>
- public bool GetHash(string strSource, ref byte[] HashData)
- {
- try
- {
- byte[] Buffer;
- System.Security.Cryptography.HashAlgorithm MD5 = System.Security.Cryptography.HashAlgorithm.Create("MD5");
- Buffer = System.Text.Encoding.GetEncoding("GB2312").GetBytes(strSource);
- HashData = MD5.ComputeHash(Buffer);
- return true;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// 获取Hash描述表
- /// </summary>
- /// <param name="strSource">待签名的字符串</param>
- /// <param name="strHashData">Hash描述</param>
- /// <returns></returns>
- public bool GetHash(string strSource, ref string strHashData)
- {
- try
- {
- //从字符串中取得Hash描述
- byte[] Buffer;
- byte[] HashData;
- System.Security.Cryptography.HashAlgorithm MD5 = System.Security.Cryptography.HashAlgorithm.Create("MD5");
- Buffer = System.Text.Encoding.GetEncoding("GB2312").GetBytes(strSource);
- HashData = MD5.ComputeHash(Buffer);
- strHashData = Convert.ToBase64String(HashData);
- return true;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// 获取Hash描述表
- /// </summary>
- /// <param name="objFile">待签名的文件</param>
- /// <param name="HashData">Hash描述</param>
- /// <returns></returns>
- public bool GetHash(System.IO.FileStream objFile, ref byte[] HashData)
- {
- try
- {
- //从文件中取得Hash描述
- System.Security.Cryptography.HashAlgorithm MD5 = System.Security.Cryptography.HashAlgorithm.Create("MD5");
- HashData = MD5.ComputeHash(objFile);
- objFile.Close();
- return true;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// 获取Hash描述表
- /// </summary>
- /// <param name="objFile">待签名的文件</param>
- /// <param name="strHashData">Hash描述</param>
- /// <returns></returns>
- public bool GetHash(System.IO.FileStream objFile, ref string strHashData)
- {
- try
- {
- //从文件中取得Hash描述
- byte[] HashData;
- System.Security.Cryptography.HashAlgorithm MD5 = System.Security.Cryptography.HashAlgorithm.Create("MD5");
- HashData = MD5.ComputeHash(objFile);
- objFile.Close();
- strHashData = Convert.ToBase64String(HashData);
- return true;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- #endregion
- #region RSA签名
- /// <summary>
- /// RSA签名
- /// </summary>
- /// <param name="strKeyPrivate">私钥</param>
- /// <param name="HashbyteSignature">待签名Hash描述</param>
- /// <param name="EncryptedSignatureData">签名后的结果</param>
- /// <returns></returns>
- public bool SignatureFormatter(string strKeyPrivate, byte[] HashbyteSignature, ref byte[] EncryptedSignatureData)
- {
- try
- {
- System.Security.Cryptography.RSACryptoServiceProvider RSA = new System.Security.Cryptography.RSACryptoServiceProvider();
- RSA.FromXmlString(strKeyPrivate);
- System.Security.Cryptography.RSAPKCS1SignatureFormatter RSAFormatter = new System.Security.Cryptography.RSAPKCS1SignatureFormatter
- (RSA);
- //设置签名的算法为MD5
- RSAFormatter.SetHashAlgorithm("MD5");
- //执行签名
- EncryptedSignatureData = RSAFormatter.CreateSignature(HashbyteSignature);
- return true;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// RSA签名
- /// </summary>
- /// <param name="strKeyPrivate">私钥</param>
- /// <param name="HashbyteSignature">待签名Hash描述</param>
- /// <param name="m_strEncryptedSignatureData">签名后的结果</param>
- /// <returns></returns>
- public bool SignatureFormatter(string strKeyPrivate, byte[] HashbyteSignature, ref string strEncryptedSignatureData)
- {
- try
- {
- byte[] EncryptedSignatureData;
- System.Security.Cryptography.RSACryptoServiceProvider RSA = new System.Security.Cryptography.RSACryptoServiceProvider();
- RSA.FromXmlString(strKeyPrivate);
- System.Security.Cryptography.RSAPKCS1SignatureFormatter RSAFormatter = new System.Security.Cryptography.RSAPKCS1SignatureFormatter
- (RSA);
- //设置签名的算法为MD5
- RSAFormatter.SetHashAlgorithm("MD5");
- //执行签名
- EncryptedSignatureData = RSAFormatter.CreateSignature(HashbyteSignature);
- strEncryptedSignatureData = Convert.ToBase64String(EncryptedSignatureData);
- return true;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// RSA签名
- /// </summary>
- /// <param name="strKeyPrivate">私钥</param>
- /// <param name="strHashbyteSignature">待签名Hash描述</param>
- /// <param name="EncryptedSignatureData">签名后的结果</param>
- /// <returns></returns>
- public bool SignatureFormatter(string strKeyPrivate, string strHashbyteSignature, ref byte[] EncryptedSignatureData)
- {
- try
- {
- byte[] HashbyteSignature;
- HashbyteSignature = Convert.FromBase64String(strHashbyteSignature);
- System.Security.Cryptography.RSACryptoServiceProvider RSA = new System.Security.Cryptography.RSACryptoServiceProvider();
- RSA.FromXmlString(strKeyPrivate);
- System.Security.Cryptography.RSAPKCS1SignatureFormatter RSAFormatter = new System.Security.Cryptography.RSAPKCS1SignatureFormatter
- (RSA);
- //设置签名的算法为MD5
- RSAFormatter.SetHashAlgorithm("MD5");
- //执行签名
- EncryptedSignatureData = RSAFormatter.CreateSignature(HashbyteSignature);
- return true;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// RSA签名
- /// </summary>
- /// <param name="strKeyPrivate">私钥</param>
- /// <param name="strHashbyteSignature">待签名Hash描述</param>
- /// <param name="strEncryptedSignatureData">签名后的结果</param>
- /// <returns></returns>
- public bool SignatureFormatter(string strKeyPrivate, string strHashbyteSignature, ref string strEncryptedSignatureData)
- {
- try
- {
- byte[] HashbyteSignature;
- byte[] EncryptedSignatureData;
- HashbyteSignature = Convert.FromBase64String(strHashbyteSignature);
- System.Security.Cryptography.RSACryptoServiceProvider RSA = new System.Security.Cryptography.RSACryptoServiceProvider();
- RSA.FromXmlString(strKeyPrivate);
- System.Security.Cryptography.RSAPKCS1SignatureFormatter RSAFormatter = new System.Security.Cryptography.RSAPKCS1SignatureFormatter
- (RSA);
- //设置签名的算法为MD5
- RSAFormatter.SetHashAlgorithm("MD5");
- //执行签名
- EncryptedSignatureData = RSAFormatter.CreateSignature(HashbyteSignature);
- strEncryptedSignatureData = Convert.ToBase64String(EncryptedSignatureData);
- return true;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- #endregion
- #region RSA 签名验证
- /// <summary>
- /// RSA签名验证
- /// </summary>
- /// <param name="strKeyPublic">公钥</param>
- /// <param name="HashbyteDeformatter">Hash描述</param>
- /// <param name="DeformatterData">签名后的结果</param>
- /// <returns></returns>
- public bool SignatureDeformatter(string strKeyPublic, byte[] HashbyteDeformatter, byte[] DeformatterData)
- {
- try
- {
- System.Security.Cryptography.RSACryptoServiceProvider RSA = new System.Security.Cryptography.RSACryptoServiceProvider();
- RSA.FromXmlString(strKeyPublic);
- System.Security.Cryptography.RSAPKCS1SignatureDeformatter RSADeformatter = new
- System.Security.Cryptography.RSAPKCS1SignatureDeformatter(RSA);
- //指定解密的时候HASH算法为MD5
- RSADeformatter.SetHashAlgorithm("MD5");
- if (RSADeformatter.VerifySignature(HashbyteDeformatter, DeformatterData))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// RSA签名验证
- /// </summary>
- /// <param name="strKeyPublic">公钥</param>
- /// <param name="strHashbyteDeformatter">Hash描述</param>
- /// <param name="DeformatterData">签名后的结果</param>
- /// <returns></returns>
- public bool SignatureDeformatter(string strKeyPublic, string strHashbyteDeformatter, byte[] DeformatterData)
- {
- try
- {
- byte[] HashbyteDeformatter;
- HashbyteDeformatter = Convert.FromBase64String(strHashbyteDeformatter);
- System.Security.Cryptography.RSACryptoServiceProvider RSA = new System.Security.Cryptography.RSACryptoServiceProvider();
- RSA.FromXmlString(strKeyPublic);
- System.Security.Cryptography.RSAPKCS1SignatureDeformatter RSADeformatter = new
- System.Security.Cryptography.RSAPKCS1SignatureDeformatter(RSA);
- //指定解密的时候HASH算法为MD5
- RSADeformatter.SetHashAlgorithm("MD5");
- if (RSADeformatter.VerifySignature(HashbyteDeformatter, DeformatterData))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// RSA签名验证
- /// </summary>
- /// <param name="strKeyPublic">公钥</param>
- /// <param name="HashbyteDeformatter">Hash描述</param>
- /// <param name="strDeformatterData">签名后的结果</param>
- /// <returns></returns>
- public bool SignatureDeformatter(string strKeyPublic, byte[] HashbyteDeformatter, string strDeformatterData)
- {
- try
- {
- byte[] DeformatterData;
- System.Security.Cryptography.RSACryptoServiceProvider RSA = new System.Security.Cryptography.RSACryptoServiceProvider();
- RSA.FromXmlString(strKeyPublic);
- System.Security.Cryptography.RSAPKCS1SignatureDeformatter RSADeformatter = new
- System.Security.Cryptography.RSAPKCS1SignatureDeformatter(RSA);
- //指定解密的时候HASH算法为MD5
- RSADeformatter.SetHashAlgorithm("MD5");
- DeformatterData = Convert.FromBase64String(strDeformatterData);
- if (RSADeformatter.VerifySignature(HashbyteDeformatter, DeformatterData))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// RSA签名验证
- /// </summary>
- /// <param name="strKeyPublic">公钥</param>
- /// <param name="strHashbyteDeformatter">Hash描述</param>
- /// <param name="strDeformatterData">签名后的结果</param>
- /// <returns></returns>
- public bool SignatureDeformatter(string strKeyPublic, string strHashbyteDeformatter, string strDeformatterData)
- {
- try
- {
- byte[] DeformatterData;
- byte[] HashbyteDeformatter;
- HashbyteDeformatter = Convert.FromBase64String(strHashbyteDeformatter);
- System.Security.Cryptography.RSACryptoServiceProvider RSA = new System.Security.Cryptography.RSACryptoServiceProvider();
- RSA.FromXmlString(strKeyPublic);
- System.Security.Cryptography.RSAPKCS1SignatureDeformatter RSADeformatter = new
- System.Security.Cryptography.RSAPKCS1SignatureDeformatter(RSA);
- //指定解密的时候HASH算法为MD5
- RSADeformatter.SetHashAlgorithm("MD5");
- DeformatterData = Convert.FromBase64String(strDeformatterData);
- if (RSADeformatter.VerifySignature(HashbyteDeformatter, DeformatterData))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- #endregion
- #endregion
- }
参考网站:
http://www.cnblogs.com/linzheng/archive/2011/02/20/1959123.html
http://www.cnblogs.com/sydeveloper/archive/2012/08/11/2633624.html
http://codego.net/126956/
C#实现RSA加密与解密、签名与认证的更多相关文章
- C#实现RSA加密与解密、签名与认证(转)
一.RSA简介 RSA公钥加密算法是1977年由Ron Rivest.Adi Shamirh和LenAdleman在(美国麻省理工学院)开发的.RSA取名来自开发他们三者的名字.RSA是目前最有影响力 ...
- python RSA加密、解密、签名
python RSA加密.解密.签名 python中用于RSA加解密的库有好久个,本文主要讲解rsa.M2Crypto.Crypto这三个库对于RSA加密.解密.签名.验签的知识点. 知识基础 加密是 ...
- 一篇搞定RSA加密与SHA签名|与Java完全同步
基础知识 什么是RSA?答:RSA是一种非对称加密算法,常用来对传输数据进行加密,配合上数字摘要算法,也可以进行文字签名. RSA加密中padding?答:padding即填充方式,由于RSA加密算法 ...
- RSA加密和解密工具类
import org.apache.commons.codec.binary.Base64; import javax.crypto.Cipher; import java.security.*; i ...
- 通过ios实现RSA加密和解密
在加密和解密中,我们需要了解的知识有什么事openssl:RSA加密算法的基本原理:如何通过openssl生成最后我们需要的der和p12文件. 废话不多说,直接写步骤: 第一步:openssl来生成 ...
- C#实现RSA加密和解密详解
原文:C#实现RSA加密和解密详解 RSA加密解密源码: Code highlighting produced by Actipro CodeHighlighter (freeware) http:/ ...
- ASP.NET Core RSA加密或解密
前言 这两天主要是公司同事用到了RSA加密,事后也看了下,以为很简单,最终利用RSACryptoServiceProvider来实现RSA加密,然后大致了解到RSACryptoServiceProvi ...
- IOS, Android, Java Web Rest : RSA 加密和解密问题
IOS, Android, Java Web Rest : RSA 加密和解密问题 一对公钥私钥可以使用 OpenSSL创建, 通常 1024位长度够了. 注意: 1. 公钥私钥是BASE64编码的 ...
- C# -- RSA加密与解密
1. RSA加密与解密 -- 使用公钥加密.私钥解密 public class RSATool { public string Encrypt(string strText, string st ...
随机推荐
- 【shell】数据文件分割
有时候我们必须把数据文件分割为更小的文件,这样方便我们邮件发送或者查看文件内容.split命令则可以用来分割文件. 一.根据大小来分割文件 1.一般分割 例如:现在有文件tmp.log,大小为:368 ...
- 使用nmap查看web服务支持的http methods
安装nmap yum install nmap 查看web server支持的http methods u02 ~]$ nmap -p --script http-methods www.somewh ...
- 移植到windows下的iconv
This is a short memo about installing iconv on Windows host (specifically: Windows 7 SP1 x64). Iconv ...
- ios中tableview侧栏的折叠
#import "ViewController.h" #define Ksmall 40.0f #define Klarge 80.0f #define KNoOpen @&quo ...
- sqlserver修改为windows验证登陆, 程序的调整
业务需求, 客户要求sqlserver改为windows验证登陆, sa用户不可用, 程序端如何修改呢? 我在本机做了个测试. 环境: sqlserver2016, springmvc+spring+ ...
- [Spring学习笔记 3 ] spring 注解详解,完全注解,常用注解
.xml使用注解 xml 用来定义bean的信息,注解用来配置依赖信息 ) 在配置文件中配置bean )在javaBean中用注解来指定依赖注入 )在配置文件中开启注解扫描 @Resource标签 j ...
- 【LeetCode】210. Course Schedule II
Course Schedule II There are a total of n courses you have to take, labeled from 0 to n - 1. Some co ...
- Unix awk使用手册
什么是awk? 你可能对UNIX比较熟悉,但你可能对awk很陌生,这一点也不奇怪,的确,与其优秀的功能相比,awk还远没达到它应有的知名度.awk是什么?与其它大多数UNIX命令不同的是,从名字上看, ...
- Linux IO系统分析(scsi篇)
一.概述 Linux内核中SCSI子系统由SCSI上层,中间层,底层驱动模块三部分组成,负责管理SCSI资源和处理其他子系统,如文件系统,提交到SCSI子系统中的IO请求. 因此,理解SCSI子系统的 ...
- Spring3整合Quartz实现定时作业
Quartz是OpenSymphony开源组织在Job scheduling领域又一个开源项目,它可以与J2EE与J2SE应用程序相结合也可以单独使用.Quartz可以用来创建简单或为运行十个,百个, ...