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]](https://i.imgur.com/MxGWZ4W.png)
And source:
![[Image: MxGWZ4W.png]](https://i.imgur.com/MxGWZ4W.png)
And source:
![[Image: Syr3DlV.png]](https://i.imgur.com/Syr3DlV.png)
|
C#
Encrypt/Decrypt with ease (Rijndael, TripleDES, DES, RC2) |
|
Apr 20, 2018 02:52 AM
(This post was last modified: Apr 20, 2018 02:54 AM by Dalvik.)
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. |
|
|
| Possibly Related Threads... | |||
| Thread / Author | Replies | Views | Last Post |
| [.NET] by DrizzyMay 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 |