Skip to content

Commit

Permalink
Imporve read me file
Browse files Browse the repository at this point in the history
  • Loading branch information
maythamfahmi committed Apr 23, 2023
1 parent 7e122ba commit 0b7ec83
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
[![Passing build workflow](https://github.com/maythamfahmi/CryptoNet/actions/workflows/ci.yml/badge.svg)](https://github.com/maythamfahmi/CryptoNet/actions/workflows/ci.yml)
[![Generic badge](https://img.shields.io/badge/support-.NET%20Standard%202.0-blue.svg)](https://github.com/maythamfahmi/CryptoNet)

# Introdution
:rocket: CryptoNet is simple, fast and a lightweight asymmetric and symmetric encryption NuGet library supporting .NET Standard 2.0 and C# 8.0 for cross platforms Windows, Linux, iOS.
# Introduction
:rocket: CryptoNet is simple, fast, and a lightweight asymmetric and symmetric encryption NuGet library supporting .NET Standard 2.0 and C# 8.0 for cross platforms Windows, Linux, iOS.
It is a 100% native C# implementation based on [Microsoft](https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography?view=net-6.0) cryptography.
It does not depending on other library.
It does not depend on other libraries.

## Installation

Expand All @@ -30,27 +30,27 @@ https://maythamfahmi.github.io/CryptoNet
- !!!Breaking change!!!
- Refactoring RSA asymmetric encryption.
- Introducing AES symmetric encryption.
- Adapt RSA PEM exporting and importing helpers with example.
- Windows symmetric encryption from v.1.6 is no longer avaible.
- Adapt RSA PEM exporting and importing helpers with examples.
- Windows symmetric encryption from v.1.6 is no longer available.

#### [![Nuget](https://img.shields.io/badge/nuget-v1.6.0-blue?style=social)](https://www.nuget.org/packages/CryptoNet/1.6.0) [![Release%20Code](https://img.shields.io/badge/release%20code-v1.6.0-blue?style=social)](https://github.com/maythamfahmi/CryptoNet/releases/tag/v1.6.0)
- Adapt RSA instance for customization.
- Adapt RSA customization example for PEM exporting and importing.

#### [![Nuget](https://img.shields.io/badge/nuget-v1.5.0-blue?style=social)](https://www.nuget.org/packages/CryptoNet/1.5.0) [![Release%20Code](https://img.shields.io/badge/release%20code-v1.5.0-blue?style=social)](https://github.com/maythamfahmi/CryptoNet/releases/tag/v1.5.0)
- Reintroducing symmetric encryption only for Windows OS.
- Adding Source Link, Deterministic and Compiler Flags to NuGet package.
- Adding Source Link, Deterministic, and Compiler Flags to the NuGet package.
- Readme enhancement.

#### [![Nuget](https://img.shields.io/badge/nuget-v1.2.0-blue?style=social)](https://www.nuget.org/packages/CryptoNet/1.2.0) [![Release%20Code](https://img.shields.io/badge/release%20code-v1.2.0-blue?style=social)](https://github.com/maythamfahmi/CryptoNet/releases/tag/v1.2.0)
- Change from RSACryptoServiceProvider to RSA factory that support cross platforms (Windows, Linux, iOS).
- No longer support for symmetric encryption from version 1.0.0.
- Change from RSACryptoServiceProvider to RSA factory that supports cross platforms (Windows, Linux, iOS).
- No longer support symmetric encryption from version 1.0.0.
- Console examples and Unit testing refactored.
- Support for X509Certificate2.

#### [![Nuget](https://img.shields.io/badge/nuget-v1.0.0-blue?style=social)](https://www.nuget.org/packages/CryptoNet/1.0.0) [![Release%20Code](https://img.shields.io/badge/release%20code-v1.0.0-blue?style=social)](https://github.com/maythamfahmi/CryptoNet/releases/tag/v1.0.0)

- Ability to encrypt and decrypt files like, images, word, excel etc.
- Ability to encrypt and decrypt files like, images, word, excel, etc.
- Improvement documentation

## Issues
Expand All @@ -70,28 +70,28 @@ The library can be used in 2 ways:
You use the same key (any secret key) for encryption and decryption.

#### Asymmetric way
With asymmetric way, the library can use its own self-generated RSA key pairs (Private/Public key) to encrypt and decrypt content.
In an asymmetric way, the library can use its own self-generated RSA key pairs (Private/Public key) to encrypt and decrypt content.

You can store the private key on one or more machines. The public key can easily distribute to all clients.

> Note: Please be aware of not to distribute private key publicly and keep it in a safe place. If private key mistakenly gets exposed, you need to re-issue new keys. The content that is already encrypted with private key, can not be decrypted back with the new generated private key. So before updating private key or deleting the old key ensure all your content are decrypted, other wise you lose the content.
> Note: Please be aware not to distribute private key publicly and keep it in a safe place. If a private key mistakenly gets exposed, you need to reissue new keys. The content that is already encrypted with the private key, can not be decrypted back with the newly generated private key. So before updating the private key or deleting the old key ensure all your content is decrypted, otherwise, you lose the content.
It is also possible to use asymmetric keys of X509 Certificate instead of generating your own keys.
It is also possible to use asymmetric keys of the X509 Certificate instead of generating your own keys.

The main concept with asymmetric encryption, is that you have a Private and Public key. You use Public key to encrypt the content with and use Private key to decrypt the content back again.
The main concept with asymmetric encryption is that you have a Private and Public key. You use the Public key to encrypt the content and use the Private key to decrypt the content back again.

You find the comlete and all examples for:
You find the complete and all examples for:

- Rsa encryption [here](https://github.com/maythamfahmi/CryptoNet/blob/main/CryptoNet.Cli/ExampleRsa.cs)
- Aes encryption [here](https://github.com/maythamfahmi/CryptoNet/blob/main/CryptoNet.Cli/ExampleAes.cs)


Here is some of the examples:
Here are some examples:

### Examples

### Example: Encrypt and Decrypt Content With Symmetric Key
In this example CryptoNetAes generate random key and iv, hence we use the same instance we can both encrypt and decrypt.
In this example CryptoNetAes generate a random key and iv, hence we use the same instance we can both encrypt and decrypt.
```csharp
ICryptoNet cryptoNet = new CryptoNetAes();
var key = cryptoNet.ExportKey();
Expand Down Expand Up @@ -155,11 +155,11 @@ Debug.Assert(ConfidentialDummyData == decryptWithPrivateKey);
```

## Build and Testing
You have different options to build and run unit test from:
You have different options to build and run the unit tests from:
1. Visual Studio 2019/2022.
2. dotnet command line.
3. start Powershell, and run ```build.ps1``` from solution folder.
4. Docker, run following command from solution folder:
4. Docker, run the following command from the solution folder:

```
docker build . --file .\Dockerfile --tag cryptonet-service:latest
Expand All @@ -169,10 +169,10 @@ docker build . --file .\Dockerfile --tag cryptonet-service:latest

You are more than welcome to contribute in one of the following ways:

1. Basic: Give input, suggestion for improvement by creating issue and lable it https://github.com/maythamfahmi/CryptoNet/issues
2. Advance: if you have good knowledge of C# and Cryptography just grab one of the issues, feature or refactoring and add a pull request.
3. Documentation: Add, update or improve documentation, by makeing pull request.
1. Basic: Give input, and suggestions for improvement by creating an issue and labeling it https://github.com/maythamfahmi/CryptoNet/issues
2. Advance: if you have good knowledge of C# and Cryptography just grab one of the issues, features, or refactoring and add a pull request.
3. Documentation: Add, update, or improve documentation, by making a pull request.

### How to contribute:

[Here](https://www.dataschool.io/how-to-contribute-on-github/) is a link to learn how to contribute if you are not a ware of how to do it.
[Here](https://www.dataschool.io/how-to-contribute-on-github/) is a link to learn how to contribute if you are not aware of how to do it.

0 comments on commit 0b7ec83

Please sign in to comment.