maythamfahmi / CryptoNet

CryptoNet is simple, fast and a lightweight asymmetric and symmetric encryption library.
https://github.com/maythamfahmi/CryptoNet
MIT License
101 stars 19 forks source link

[feature request]: Implement DSA algorithm #93

Open maythamfahmi opened 1 month ago

maythamfahmi commented 1 month ago

https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.dsa.create?view=net-6.0

maythamfahmi commented 1 month ago

Not sure yet, but condering moving it to be part of extension package for CryptoNet

jwdonahue commented 3 weeks ago

I don't understand the purpose of the extension package. Last time I looked, there were no extension methods in that assembly.

maythamfahmi commented 3 weeks ago

@jwdonahue the whole idea was that I wanted to introduce som extension methods in a seperate package lets for now call it crypto net extension pack. so the current extension will be reused in extension package. There are some re-thinking of archecture I need to do. So it might change a bit. I am not 100% sure yet.

jwdonahue commented 3 weeks ago

Reasons to have a separate assembly in your library package:

Reasons not to have a separate assembly in your library package:

Reasons to have a separate package:

Reasons not to have a separate package:

I probably missed more than a few.

I am sure that I have ignored every one of those ideas, at one time or another, for one arbitrary reason or another. I think sometimes maybe I just happen to come up with a good name for some collection of bits and want to apply it to them. In other words, it can be a matter of taste.

maythamfahmi commented 3 weeks ago

Thanks for sharing

Main reason

Cryptonet using .net standard 2 for compatibility reasons. While extension pack has some helpers methods that require. Net 8.0.

I am working on feature #127 it is getting a better form with refactoring of naming and moving stuff. Still not finished but with couple of days I think will be done.

jwdonahue commented 3 weeks ago

I use conditional compilation for those bits.

I have have this in most of my solution folder's Directory.Build.Props file:

preview true net8.0;net9.0 enable enable true $(SolutionDir)={SHLLC/CoreLibs/$(SolutionName)}/

I use conditional compilation. For instance, this little gem:

#if NET9_0_OR_GREATER
    private static readonly Lock _lock = new();
#else
    private static readonly object _lock = new();
#endif
jwdonahue commented 3 weeks ago

Extensions is a C#-ism:

int ExtensionMethod(this object) ...

Hence my confusion around the extension assembly.

jwdonahue commented 3 weeks ago

I've also dropped support for everything below Net8 in my own projects.