Skip to content

CryptoNet is simple, fast and a lightweight asymmetric and symmetric encryption library.

License

Notifications You must be signed in to change notification settings

itbackyard/CryptoNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cryptonet

GitHub CryptoNet NuGet version Passing build workflow Generic badge Code Coverage Build status

Introduction

🚀 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, and iOS. It is a 100% native C# implementation based on Microsoft cryptography. It does not depend on other libraries.

Installation

You can install the CryptoNet NuGet package via NuGet.

Website

https://itbackyard.github.io/CryptoNet

Versions

Nuget is latest version and are maintained.

CryptoNet v3:

  • RSA: Asymmetric cryptographic algorithm used for secure data transmission and digital signatures.
  • AES: Symmetric cryptographic algorithm used for fast and secure data encryption.
  • DSA: Asymmetric cryptographic algorithm used for digital signatures

CryptoNet Extensions v3:

  • RSA PEM exporting and importing.
  • Support for X509Certificate2.
  • Ability to encrypt and decrypt text, and files like images, word, excel, and any byte content.
  • Cross-platform compatible with Windows, Linux, and iOS.

Issues

Please report issues here.

How to use

Ref to docs.

Build and Testing

You have different options to build and run the unit tests from:

  1. Visual Studio 2019/2022.
  2. Visual Studio Code.
  3. dotnet command line.
  4. dotnet commands are preserved in a PowerShell script build.ps1.
  5. Docker, run the following command from the solution folder:
docker build . --file .\Dockerfile --tag cryptonet-service:latest

or run preserved PowerShell:

./run_docker_build.ps1

How to release a new version?

Preview

.\run_release.ps1 -VersionNumber 3.0.0 -IsPreview $true

Release

.\run_release.ps1 -VersionNumber 3.0.0 -IsPreview $false

Documentation Creation

There are static and dynamically generated documentation. Both are published automatically in the pipeline called 5-static.yml.

To work with the documentation locally, the following might be relevant:

  • Static base documentation is located in the docs folder.
  • Dynamically generated documentation is created from code using a tool called DocFX.

Running Documentation Creation Locally

To generate the documentation locally on your computer, run:

.\run_docs.ps1

Setup

  1. Install the DocFX tool (only needs to be done once):
dotnet tool install -g docfx
  1. The following step is already configured in this repository. However, if you need to start over, run the following to initialize and configure DocFX:
docfx init -y

Update index.md with README.md

To update index.md with the latest content from README.md, run the following command:

./run_update_index.ps1

This script will:

  1. Add the following header to the top of index.md:
---
_layout: landing
---
  1. Append the content of README.md to index.md.

This ensures that index.md is always up to date with the latest changes in README.md.

Code Coverage

Code coverage ensures that your tests adequately cover your codebase, improving overall quality, reliability, and maintainability. Follow these steps to set up and generate code coverage reports.

Running Code Coverage Locally

To generate code coverage reports locally on your computer, run the following command in Windows:

.\run_codecoverage.ps1

Setup

If the required tools and packages are not set up locally, follow the steps below to configure them:

  1. Navigate to your test project directory (e.g., CryptoNet.UnitTests):
cd .\CryptoNet.UnitTests\
  1. Add the necessary coverage packages to your test project:
dotnet add package coverlet.collector
dotnet add package coverlet.msbuild
  1. Install the report generator tool (only needs to be done once):
dotnet tool install --global dotnet-reportgenerator-globaltool

Once set up, you can use these tools to analyze and generate detailed code coverage reports to ensure thorough testing of your application.

Contributing

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

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

How to contribute:

Here is a link to learn how to contribute if you are not aware of how to do it.