FmgLib.Cryption 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FmgLib.Cryption --version 1.2.0                
NuGet\Install-Package FmgLib.Cryption -Version 1.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FmgLib.Cryption" Version="1.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FmgLib.Cryption --version 1.2.0                
#r "nuget: FmgLib.Cryption, 1.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FmgLib.Cryption as a Cake Addin
#addin nuget:?package=FmgLib.Cryption&version=1.2.0

// Install FmgLib.Cryption as a Cake Tool
#tool nuget:?package=FmgLib.Cryption&version=1.2.0                

Install

This package provides encryption operations. In order to include the package in the project; From the Program.cs file:

builder.Services.AddFmgLibCryption("jsonPath");

OR

builder.Services.AddFmgLibCryption(builder.Configuration);

code should be added.

public class MyClass
{
     ICryption _cryption;
     IPasswordCryption _passwordCryption;

     public MyClass(ICryption cryption, IPasswordCryption passwordCryption)
     {
         _cryption = cryption;
         _passwordCryption = passwordCryption;
     }

     public void crypt()
     {
         var temp = _cryption.Encryption("Hello, World!");
         Console.WriteLine();
         Console.WriteLine(_cryption.Decryption(temp));
     }
}

you can use it easily.

Or if you don't want to add it via Program.cs, you can use it like this;

public class MyClass
{
     Cryption _cryption = new Cryption();
     PasswordCryption _passwordCryption = new PasswordCryption();

     public void crypt()
     {
         var temp = _cryption.Encryption("Hello, World!");
         Console.WriteLine();
         Console.WriteLine(_cryption.Decryption(temp));
     }
}

It encrypts according to the string you have specified and the 5 prime numbers you have specified. Thus, it becomes impossible to decrypt your password, because the encryption sequence and numbers are kept by you alone.

In your .json file should be kept like this:

{
  "FmgLibCryption": {
    "Chars": "$IJP#FGK%OH@!4S[TU5bc(de>fgC<Dh-tuEv+no/*a_ij}x]L7kly2VW{X36B8w0?;qr9m)ps:AMR=YZ^z1&NQ",
    "Numbers": "4987,11,7907,239,7213"
  }
}

Things to consider in .json format: 1- 'FmgLibCryption', 'Numbers' and 'Chars' key names should be written exactly like this. 2- 'Numbers' must have exactly 5 number values in its value. (In case of missing, the remaining numbers are taken as 0. In case of excess, the numbers written in excess are not taken into account.) 3- You must separate the numbers in the value of the 'Numbers' with the ',' character. 4- You can change the value for the 'Chars' as you wish. Likewise, you can change the values for the 'Numbers' as you wish. (Since these values are used in the encryption method, your encryption will vary depending on the values here.)

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.1 100 6/11/2024
1.2.0 75 6/11/2024
1.1.0 142 1/19/2024
1.0.8 189 4/12/2023
1.0.7 205 4/1/2023