如何选择哪种加密和解密算法最佳C#? [英] How do I select which encryption and decryption algorithm is best C#?

查看:260
本文介绍了如何选择哪种加密和解密算法最佳C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须为超过200 MB的大文件编写ac#加密和解密。

请有人为我的问题提供快速安全的算法建议



我尝试过:



我尝试过AES和DES算法。但是需要时间。

我也试过了Partial-Encryption。但它没有给出正确的解决方案。

I have to write a c# encryption and decryption for large files which are more than 200 MB.
Please anyone provide the fast and secure algorithm suggestion for my problem

What I have tried:

I tried AES and DES Algorithms. But is taking time.
I tried Partial-Encryption also. But its not given correct solution.

推荐答案

引用:

如何选择哪种加密和解密算法最好C#?

How do I select which encryption and decryption algorithm is best C#?



这个问题没有答案,因为我们没有必要的信息。我们不知道您的文件有多重要,也不知道上下文。

C#的答案与任何其他语言的答案相同,因为语言并不重要。任何加密算法都可以用任何语言编写。

加密算法或多或少都是一种权衡。快速算法会很弱,强大的算法会很慢。一些程序员可以做弱和慢的算法,但这是另一个问题。



加密算法的选择取决于很多事情,问题是什么是足够安全?

它取决于:

- 文件大小。

- 文件的秘密。

- 文件过时的速度有多快。

- 密钥的安全性。

等......


There is not answer to this question because we don't have the necessary information. We don't know how important are your files, nor the context.
The answer for C# is the same as for any other language, because language does not matter. Any encryption algorithm ca, be written in any language.
Encryption algorithms, more or less, are a trade off. Fast algorithms will be weak, strong one will be slow. Some programmer can do weak and slow algorithms, but that is another problem.

The choice of an encryption algorithm depend on a lot of things, the problem is "What is secure enough ?"
It depend on:
- File size.
- How secret is the file.
- How fast the file become obsolete.
- How safe is the key.
and so on ....


如果您想要快速性能,请使用256位密钥和CBC密码模式的AES,因为大多数现代硬件(CPU)都支持它。

有关更多信息,请参阅此文章:

< a href =https://www.codeproject.com/Articles/789084/Swanky-encryption-decryption-in-Csharp> C#中的时髦加密/解密 [ ^ ]
Go for AES with 256bit key and CBC cipher mode if you want fast performance, because most modern hardware (CPU's) supports it.
See this article for more information:
Swanky Encryption/Decryption in C#[^]


这篇关于如何选择哪种加密和解密算法最佳C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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