-
-
Notifications
You must be signed in to change notification settings - Fork 967
Use BCL CipherMode enum for AesCipher class #1564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
166cd93 to
e02f749
Compare
|
Is there a benefit to this? |
|
FYI: some previous discussion: #865 (comment) |
|
The main purpose is to use BCL as possible as it can. |
|
Thanks, I remember the previous discussion, but I don't think it is worth changing the API right now. Maybe at a later time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the cipher implementation to use the BCL CipherMode enum instead of a custom AesCipherMode enum, and creates a dedicated AesCtrCipher class similar to the existing AesGcmCipher class. The changes remove support for DES-EDE3-CFB encryption and eliminate custom cipher mode implementations in favor of BCL-provided functionality.
- Replaced custom
AesCipherModeenum with BCL'sSystem.Security.Cryptography.CipherMode - Created dedicated
AesCtrCipherclass for CTR mode encryption - Removed DES-EDE3-CFB support and associated test data
- Simplified cipher implementations by removing custom mode classes (CFB, CTR, OFB, CBC)
Reviewed Changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/Renci.SshNet/Security/Cryptography/Ciphers/AesCipher.cs |
Refactored to use BCL CipherMode and simplified implementation |
src/Renci.SshNet/Security/Cryptography/Ciphers/AesCtrCipher.cs |
New dedicated class for AES-CTR mode |
src/Renci.SshNet/Security/Cryptography/Ciphers/TripleDesCipher.cs |
Refactored to use BCL CipherMode |
src/Renci.SshNet/PrivateKeyFile.*.cs |
Updated cipher instantiation to use BCL CipherMode |
src/Renci.SshNet/ConnectionInfo.cs |
Updated cipher configurations to use new class constructors |
test/**/*CipherTest*.cs |
Updated tests to use BCL CipherMode and new AesCtrCipher class |
| Multiple cipher mode files | Removed custom implementations (CFB, CTR, OFB, CBC, CipherMode base) |
test/Data/Key.RSA.Encrypted.Des.Ede3.CFB.* |
Removed test data for unsupported DES-EDE3-CFB |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/Renci.SshNet/Security/Cryptography/Ciphers/TripleDesCipher.cs
Outdated
Show resolved
Hide resolved
1b1c639 to
86d3a29
Compare
86d3a29 to
0a89a35
Compare
|
IMHO, SSH.NET should be the client of SSH but not a cryptography library. That's the reason why I hide |
… class; Create a dedicated AesCtrCipher class just like AesGcmCipher class.
0a89a35 to
2b4037b
Compare
|
Could you please have another review of this PR please? @Rob-Hague |

Create a dedicated AesCtrCipher class just like AesGcmCipher class.
Relate to #1560