Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Encrypt/Decrypt with ease (Rijndael, TripleDES, DES, RC2)

Wrote a quick wrapper class for all built-in encryptions in .NET 2.0. It's very simple to use. Here's a demo:

[Image: MxGWZ4W.png]

And source:
[Image: Syr3DlV.png]
The encrypt and decrypt functions are basically the same aside from the fact that one calls CreateEncryptor and one calls CreateDecryptor.

I worked with Rijndael before and to tackle that problem I made an abstract parent class with an abstract CreateCryptor method that returns CreateDecryptor in the inherited Decryptor class, and CreateEncryptor in the inherited Encryptor class. Since you have it all cramped into one class you can look into Func, so you can still make it a single method.

Also why make a local variable and then later instantiate it in the using block? You do this everytime you use a using block, but there is absolutely no reason to.
According to OpenSSL TripleDES, DES, and RC2 are considered not safe to use for production.

Thanks for contribution.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by Drizzy‎‎May 29, 2026 02:17 AM 61 4,750 May 29, 2026 02:17 AM
Last Post: dvs1626
by div-boyJul 23, 2025 11:08 AM 0 81 Jul 23, 2025 11:08 AM
Last Post: div-boy
[Python] by 000Jun 4, 2019 12:24 PM 6 233 Jun 4, 2019 12:24 PM
Last Post: 000