VarEnc 1.2.0

dotnet add package VarEnc --version 1.2.0                
NuGet\Install-Package VarEnc -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="VarEnc" Version="1.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VarEnc --version 1.2.0                
#r "nuget: VarEnc, 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 VarEnc as a Cake Addin
#addin nuget:?package=VarEnc&version=1.2.0

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

VarEnc

The idea is to make the encryption of values in C# easier. Let's say you have a video game with an "int" variable containing the player's score. With simple software like CheatEngine and many more, you can search for this variable and change it. The VarEnc project has an easy solution for that. All you got to do is to change the type of the variable from "int", to "EncInt". Done. Your game will work the same but the score of the player will be encrypted in the background. These called EncTypes, they are the alternative encrypted version of their normal variables version (EncString for string, EncInt for int, and so on). You can also combine and/or compare an EncType with its normal type and vice versa. They will work the same as their normal type, and every EncType has every method its normal version has. The performance cost is also minimal considering the encryption level, especially for videogames made with Unity (Just don't make every variable encrypted, only the ones you know you don't want a player to change with cheating software. At least not that easily, every "Client-Side" stuff can be hacked).

Which types to use?

  • EncInt - For storing an int. Every time you change its value, the random encryption keys that affect its value change too.
  • EncLong - The same thing as the struct above, but for a 64-bit integer (a long).
  • EncFloat - The same thing as the struct above, but for a Single (float).
  • EncDouble - The same thing as the struct above, but for a Double.
  • EncDecimal - The same thing as the struct above, but for a Decimal.
  • EncString - An EncType class for a string type.

Benchmark And Performance

The VarEnc repo contains a benchmark console application to test the efficiency of its types.
When it's running, the application will perform a certain amount of tests on the types you chose.
In each test, the application will change the value of a certain variable-type a certain amount of time.

At first, you'll have to choose the types you want to compare.
Then how long you want the benchmark to be (Fast, Normal, Long, etc), and after that choose a benchmark preset.
After the benchmark is finished, the results will be printed. From there you can press Enter (or any key) and it'll take you back to the main menu.

Performance

I ran a few benchmarks on my Laptop, and these are the results:

Variable Type - CPS (Changes per second): EncInt - 48,137,557 EncLong - 10,216,779 EncFloat - 6,462,340 EncDouble - 4,367,976 EncDecimal - 5,111,549 EncString - 1,809,394

This is the size of each EncType: EncInt - 8 bytes EncLong - 16 bytes EncFloat- 8 bytes EncDouble - 16 bytes EncDecimal - 32 bytes

It may seem heavy but it's very light considering its simple and efficient encryption.
In a game where you want to have an encrypted "score" for the player, you can just switch the score's variable type from an int to an EncInt.
They work the same, behave the same, and have the same methods and functionality.
How many time you change the score variable? How many variables you want to be encrypted?
Even if you'll have 1,000,000 encrypted variables that you want to change at once (it is probably unnecessary to have all of them enc), you can do it and you'll have exactly the same framerate. It is a very light encryption solution.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.

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.0 315 12/19/2022
1.1.0 433 1/2/2021
1.0.0 402 1/2/2021