SubstitutionCiphers 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SubstitutionCiphers --version 1.0.0
                    
NuGet\Install-Package SubstitutionCiphers -Version 1.0.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="SubstitutionCiphers" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SubstitutionCiphers" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SubstitutionCiphers" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SubstitutionCiphers --version 1.0.0
                    
#r "nuget: SubstitutionCiphers, 1.0.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.
#:package SubstitutionCiphers@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SubstitutionCiphers&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SubstitutionCiphers&version=1.0.0
                    
Install as a Cake Tool

Griffinere Cipher 🔐

The Griffinere cipher is a custom encryption algorithm in C# designed for reversible, base64-normalized encryption using a repeating key. Inspired by the Vigenère cipher, it adds configurable alphabet support, input validation, and padding-based encryption length enforcement.


📦 Installation

Clone this repository or copy the Griffinere.cs file into your .NET project.

https://github.com/RileyG00/Ciphers

In your code:

using Ciphers;

✨ Features

🔐 Encrypts and decrypts alphanumeric or custom alphabet-based strings

🧩 Allows defining your own alphabet

📏 Supports minimum-length encrypted responses via padding

✅ Includes strong validation for alphabet and key integrity

🧪 Unit tested with xUnit

🧰 Usage

1.1: Creating the Cipher Using the default alphabet:

string key = "YourSecureKey123";
Griffinere cipher = new(key);

Default alphabet includes:

A-Z
a-z
0-9

1.2: Creating the Cipher Using a custom alphabet:

string customAlphabet = "abcdef123456";
string key = "a1c";
Griffinere cipher = new(customAlphabet, key);

Alphabet Rules

  1. Must not contain . (dot character)
  2. All characters must be unique
  3. All characters in the key must exist in the alphabet

2.1: Encrypt a String

string plainText = "Hello World 123";
string encrypted = cipher.EncryptString(plainText);

2.2: Encrypt a String with Minimum Length

string plainText = "Hello World 123";
string encrypted = cipher.EncryptString("Short text", minimumResponseLength: 24);

3.1: Decrypt a String

string decrypted = cipher.DecryptString(encrypted);
// Returns the original plain text

⚠️ Exceptions and Validations

Tables

Condition Exception
Alphabet contains . ArgumentException
Alphabet has duplicate characters ArgumentException
Key contains characters not in alphabet ArgumentException
Encrypting empty/null text ArgumentNullException
Specifying minimum length < 1 ArgumentOutOfRangeException

📄 License

MIT License © 2025 Riley Griffin

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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
2.1.0 135 9/2/2025
2.0.0 199 8/24/2025
1.1.1 483 7/21/2025
1.1.0 137 7/17/2025
1.0.1 150 6/25/2025
1.0.0 147 6/25/2025