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 ...
随机推荐
- mysql改变字符串的大小写
INITCAP:转换每个字的第一个字符为大写LOWER:转换所有字符为小写UPPER:转换所有字符为人写 eg: LOWER(phone)
- django之创建第11个项目-页面整合
目的:将如下众多html页面整合到一个index.html页面中. 百度云盘:django之创建第11个项目-页面整合 用下面的方式实现: <!DOCTYPE html> <head ...
- PHP 反射API说明
2.API概览:class Reflection { }interface Reflector { }class ReflectionException extends Exception { }cl ...
- Fix: Windows Script Host access is disabled on this machine
If you receive this Windows Script Host access is disabled on this machine, Contact your administrat ...
- Win一键查看用户密码
测试Win7环境,能探测系统密码 Download: 链接: https://pan.baidu.com/s/1skTeNrJ 密码: avpa
- VS 2013 with update 5 编译程序出现A task was cancel
打开进程管理器看,有一堆MSBuild.exe的实例,于是用 Taskkill /IM MSBuild.exe /F 杀死了所有实例.然后再重新打开VS2013,就work了. references: ...
- 十问Android NFC手机上的卡模拟(转)
1, 问:能否在AndroidNFC手机上实现卡模拟? 答:在技术上可行,但是,对一般开发人员来讲,目前看来仅仅是技术上可行:( 2, 问:具体如何实现呢? 答:有两种方式:一种是基于硬件的,被称 ...
- 抗衡Win Linux全凭这些桌面环境
2012年01月25日 元老级桌面环境KDE Linux操作系统最早使用在服务器上,而桌面操作系统并不是Linux的重点突围.但是,近几年Linux桌面操作系统有崛起的趋势,抢夺了部分桌面操作 ...
- Linux删除文件出现rm: cannot remove `.user.ini': Operation not permitted
转自:https://blog.csdn.net/sinat_35861727/article/details/79040755 在Linux中rm -rf的威力是十分巨大的,特别是附带了 -f 参数 ...
- springmvc是如何和前端页面联系起来的
springmvc的使用,在controller中通过注解的形式,获取从前端jsp页面传过来的action参数. 方法/步骤 使用springmvc必须在web.xml中配置(Dispatcher ...