加密库? [英] Encryption libraries?

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

问题描述

我一直负责实施在C#中的PKI库公司项目,并一直未能找到一个很好的实现它。似乎有多个库,并指向已被删除的MSDN库许多断开的链接。我见过使用Crypt32.dll人,人们建立自己的图书馆,用P民/ Invoke来访问系统证书存储,人们延长内置库,例如根本不适用于C#(如Java示例)和商业库。

I have been tasked with implementing a PKI library in C# for a company project, and have been unable to find a good implementation of it. There appear to be multiple libraries, and many broken links pointing to MSDN libraries that have been removed. I've seen people using Crypt32.dll, people building their own libraries, people using P/Invoke to access system certificate stores, people extending the built-in libraries, examples that simply don't apply to C# (e.g. Java examples), and commercial libraries.

我的问题是,它实现/库最值得推荐的简单的数据加密/解密?

My question is, which implementation/library is most recommended for simple encryption/decryption of data?

由于一些背景什么我打算用它做什么,我只需要使用加密私钥(.PFX)消息,并与公共密钥(.CER)解密。消息签名和认证不要求在此级别的项目的,虽然它可能是在将来。
我见过参考加密长度这让我感到不安。我们需要能够加密任意长度的消息(在合理范围内,当然!)。这是不是我需要担心,如果有的话,是有办法来对付它?

As some background for what I plan to do with it, I simply need to encrypt messages using a private key (.pfx), and decrypt with public keys (.cer). Message signing and authentication isn't required at this level of the project, although it may be in future. I have seen reference to encryption lengths which make me uneasy. We need to be able to encrypt any length message (within reason, of course!). Is this something I need to worry about, and if so, is there a way to deal with it?

我不希望公/私钥保存在windows证书管理器,如果在所有可能的,但如果它使执行显著简单,就这样吧。

I would prefer not to store public/private keys in the windows certificate manager if at all possible, but if it makes implementation significantly simpler, so be it.

我认识PKI和加密是一个庞大而复杂的问题,但我希望有个比较简单的库反正...(我们可以希望,对吧?)

I realize PKI and encryption is a large and complex subject, but I'm hoping for a relatively simple library anyway... (one can hope, right?)

谢谢!

推荐答案

好吧,你没有提到的内置类不包括你的需要,那么怎么样的 System.Security.Cryptography.RSACryptoServiceProvider

Well, you did not mention that the built-in class doesn't cover your need, so how about System.Security.Cryptography.RSACryptoServiceProvider?

据大集资格的方式非对称加密/解密流

It has a large set qualified ways to asymmetrically encrypt/decrypt streams.

有几个教程/指南,带你一路走来:

There are several tutorial/guides to take you along the way:

http://www.codeproject.com/KB /security/RSACryptoPad.aspx

http://www.eggheadcafe.com/articles/20020630.asp

有数不清的通过的谷歌

更新:关于长度restrictments,它不应该有任何问题,如果你只是实现两侧,加密和解密使用同样的缓存算法

Update: About the length-restrictments, it's should not be any problems if you just implement the same buffer-algorithm on both sides, encryption and decryption.

UPDATE2 :是的,我的例子是, RSACryptoProvider ,但您可以使用从的 System.Security.Cryptography.AsymmetricAlgorithm ,如果​​你想有一个公钥/私钥的解决方案。或者建立你自己的......或许不是:)

Update2: Yes, my example was RSACryptoProvider, but you can use any class that derives from System.Security.Cryptography.AsymmetricAlgorithm, if you want a public/private key-solution. Or build your own... or maybe not :)

这篇关于加密库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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