加密&使用c#解密算法 [英] encryption & decryption Algorithm using c#

查看:151
本文介绍了加密&使用c#解密算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,



我正在开发Windows应用程序。

我计划让应用程序安全,所以我需要实现一个激活过程。



我想开发一个加密&解密算法所以我可以读取客户端参数&可以为它创建一个安全的激活密钥。



我计划使用 Blow fish 算法非常安全&易于实施。



还有其他办法吗?



任何类型的链接,建议和特别专家建议将受到高度赞赏。





问候,

Balkrishna Raut

Dear All,

I am working on Windows application.
I am planing to make application secure, so I need to implement one activation process for the same.

I want to develop an encryption & decryption algorithm so I can possibly read client side parameters & can create a secure activation key for the same.

I am planing to use Blow fish algorithm which is very secure & easy to implement.

Is there any alternative way of doing it?

Any kind of link, suggestion and specially expert advice would be highly appreciated.


Regards,
Balkrishna Raut

推荐答案

另一种解决方案是使用.NET内置加密。 (请参阅System.Security.Cryptography命名空间)

这有一个优势,即算法已经实现,测试和验证:如果您的软件因磁盘崩溃而消失(比如说),则可以如果您仍然知道密码,请恢复您的数据...



如果有一个已知的良好实施可用,我不会实施加密算法:这是浪费工作,以及潜在的安全风险。
The other solution is to use the .NET built in encryption. (See the System.Security.Cryptography namespace)
This has teh advantage that the algorithms are already implemented, tested, and proven: If your software disappears due to a disk crash (say) it is possible to restore your data if you still know the passswords...

I would not implement an encryption algorithm if there is a known good implementation available: it is a waste of work, and a potential security risk.


希望 Microsoft [ ^ ]和夏普教程 [ ^ ]会给你一个想法。
Hope Microsoft[^] and Sharp tutorial[^] will give you an idea.


.NET使用'System.Cryptography'命名空间和v提供内置加密技术多种内置加密算法,如

1. AES

2. Blowfish

3. DES

4 。三重DES

5.毒蛇

6. Twofish

7.山茶花

8. CAST-128

9. IDEA,RC2,RC5,SEED,Skipjack,TEA,XTEA,XOR等



以下是加密字符串的代码在XOR的帮助下你需要使用'System.Cryptography'

.NET provide inbuilt encryption technique using 'System.Cryptography' namespace and various in-built encryption algorithms like,
1. AES
2. Blowfish
3. DES
4. Triple DES
5. Serpent
6. Twofish
7. Camellia
8. CAST-128
9. IDEA,RC2,RC5,SEED,Skipjack,TEA,XTEA, XOR etc

Here is the code to encrypt your string with the help of XOR you need to use 'System.Cryptography'
public string EncryptDecrypt(string szPlainText, int szEncryptionKey)  
     {  
       StringBuilder szInputStringBuild = new StringBuilder(szPlainText);  
       StringBuilder szOutStringBuild = new StringBuilder(szPlainText.Length);  
       char Textch;  
       for (int iCount = 0; iCount < szPlainText.Length; iCount++)  
       {  
         Textch = szInputStringBuild[iCount];  
         Textch = (char)(Textch ^ szEncryptionKey);  
         szOutStringBuild.Append(Textch);  
       }  
       return szOutStringBuild.ToString();  
     }  



请参阅以下链接了解更多详情

PrasadDotNetTricks:使用XOR技术在.NET中进行简单加密 [ ^ ]


这篇关于加密&amp;使用c#解密算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆