-
-
Notifications
You must be signed in to change notification settings - Fork 3
Add Simple AES Class #2
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
Conversation
|
Can you please add a .gitignore in the root of the project? So it will be easier to review and won't bring the binaries in the commits? |
Ellerbach
left a comment
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.
Thanks, couple of remarks to start, once with a gitignore, it's going to be more clear :-)
Also, you're missing all the nuget and related elements including the pipeline. Checkout the docs: https://docs.nanoframework.net/content/maintainers/creating-a-new-repo.html#prepare-the-initial-commit
System.Security.Cryptography/System.Security.Cryptography/AES.cs
Outdated
Show resolved
Hide resolved
System.Security.Cryptography/System.Security.Cryptography/AES.cs
Outdated
Show resolved
Hide resolved
System.Security.Cryptography/System.Security.Cryptography/Properties/AssemblyInfo.cs
Outdated
Show resolved
Hide resolved
System.Security.Cryptography/System.Security.Cryptography/Properties/AssemblyInfo.cs
Show resolved
Hide resolved
System.Security.Cryptography/System.Security.Cryptography/Properties/AssemblyInfo.cs
Outdated
Show resolved
Hide resolved
System.Security.Cryptography/System.Security.Cryptography/packages.config
Outdated
Show resolved
Hide resolved
System.Security.Cryptography/System.Security.Cryptography/System.Security.Cryptography.nfproj
Show resolved
Hide resolved
|
This is a bit early in the process. The "base" project is still pending review and merge. Only after that it makes sense to start adding new features. 😉 |
|
so am I supposed to continue or close the Pull request ? |
Please hold until the inital version is there. Then you can merge on your working branch and take it from there. |
|
sure. I would be happy if I could participate in this work |
sure. i will apply all comments. i will try :) |
|
@AlirezaP initial version merged into main. Please merge here and take it from there. |
|
@AlirezaP can you please make sure that you don't commit the .vs folder and other non needed folders? Once done, it will be better and easier to review the code. Thanks |
|
@AlirezaP just took a quick look at this. Can you please point me to the .NET system.security.cryptography API that has this AES class? The policy is to follow the API from the full framework whenever possible. |
|
.Net system.security.cryptography (link) has AES class, but it works differently. It uses ICryptoTransform and CryptoStream to encrypt and decrypt data. But here, I use the simple method with the byte array in input and output. |
@Ellerbach I obeyed the mentioned note. As a test, I made a change in the .vs folder (I added a text file); it doesn't included in the git change. |
You have to get rid of all the files I4ve highlighted because they are part of your PR: There are 2 options:
|
|
The main goal here is to rely on the native provider for all these. For AES the full .NET version is going back and fort simply because it seems that AES has shown to have some security issues... or at least some versions(implementations) of it... I understand (and agree) that going through the MemoryStream and CryptoStream is a bit too much for embedded systems scenarios. This seems to be pointing to a need to have a lightweight approach to this API as we've done a few times. This may sound a blocker, still: we should come up with a list of algorithms that we want to have implemented and find out a common denominator for the methods and API. |
I agree and on the simplification as well. We've been added some of the crypto algo first purely on a managed way because we mainly we needed them to connect to cloud providers like Azure and AWS. We've always been also very pragmatic with all this. And we never were afraid to refactor some elements when we were able to cluster those. So, we should not neither be too afraid of bringing couple of those at first and refactor a bit later. |
you are right. however, it is worth noting that the existence of a basic implementation of this algorithm in the Nanoframeworks security library can be useful; it can be customed and optimized proportional to the embedded devices in the future. |
Ok, I will remove them from the next commit. |
Actually, I clone the branch in a new project, and everything seems to be ok. |
It is not. Can you please either remove all the files, either start clean? |
|
@Ellerbach excuse me I didn't understand before. :) |
Ellerbach
left a comment
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.
Thanks, much better without the non needed files :-) Couple of comments. What's important is to have both the API and the intellisense comments aligned with the full .NET, so it makes things easier when sharing code
move CipherMode outof aes class update intellisesne comments move text of the exception in the intellisense comments
Ellerbach
left a comment
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.
looks good all up. Can you add an example of usage in the main README?
sure. Done |
Ellerbach
left a comment
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.
Now we are good with the code, would be perfect to add few tests. You can get inspiration from the existing ones. This will allow to ensure it's still working fine. Few cases should be enough.
Ellerbach
left a comment
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.
2 little extra lines. Then good for me. @josesimoes does this PR change the native signature?
|



Description
Motivation and Context
How Has This Been Tested?
Screenshots
Types of changes
Checklist: