Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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.
Posted
Updated 15-Jun-17 15:36pm
Comments
F-ES Sitecore 15-Jun-17 10:24am    
Different methods have different uses and pros and cons. For large files the more secure methods may be too slow, so what some people do is use a quicker less secure method to encrypt the file itself, then use a more secure slower mechanism to encrypt the key that was used. It's a fairly indepth subject though, if you google for the pros and cons of various methods you should find something that will point you in the right direction.
prashureddy 15-Jun-17 10:36am    
I done more than 1 week research on that. But i did not got any idea about the procedure. So i posted here to get the correct process in step by step. Hope someone will solve this.

Quote:
How do I select which encryption and decryption algorithm is best 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 ....
 
Share this answer
 
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#[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900