https://github.com/ntdls/ntdls.permafrost
The NetworkDLS original symmetric cipher algorithm ported to C#.
https://github.com/ntdls/ntdls.permafrost
cryptography library nuget showcase
Last synced: 4 months ago
JSON representation
The NetworkDLS original symmetric cipher algorithm ported to C#.
- Host: GitHub
- URL: https://github.com/ntdls/ntdls.permafrost
- Owner: NTDLS
- License: mit
- Created: 2023-11-02T19:57:41.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-14T02:54:38.000Z (7 months ago)
- Last Synced: 2025-11-14T03:10:50.347Z (7 months ago)
- Topics: cryptography, library, nuget, showcase
- Language: C#
- Homepage: https://networkdls.com/Entity/ntdls-permafrost
- Size: 818 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NTDLS.Permafrost
📦 Be sure to check out the NuGet package: https://www.nuget.org/packages/NTDLS.Permafrost
Permafrost encryption library, derived from NASCCL. The NetworkDLS Algorithmic Symmetric Cipher Cryptography Library.
## Simple string encryption example:
```
using var permafrost = new PermafrostCipher("ThisIsTheP@$$w0Rd!", PermafrostMode.AutoReset);
var cipherBytes = permafrost.Cipher("This is some text that I would like to keep safe if that is ok with you? Oh, it is? Good!");
var decipherBytes = permafrost.Cipher(cipherBytes);
string decipheredText = Encoding.UTF8.GetString(decipherBytes);
```
## Streaming example with chaining.
```
public static void EncryptAndCompressFile(string inputPath, string outputPath)
{
byte[] buffer = new byte[8192];
using var input = File.OpenRead(inputPath);
using var output = File.Create(outputPath);
using var permafrost = new PermafrostStream(output, "ThisIsTheP@$$w0Rd!");
using var gzip = new GZipStream(permafrost, CompressionLevel.SmallestSize);
int bytesRead;
while ((bytesRead = input.Read(buffer, 0, buffer.Length)) > 0)
{
gzip.Write(buffer, 0, bytesRead);
}
}
public static void DecryptAndDecompressFile(string inputPath, string outputPath)
{
byte[] buffer = new byte[8192];
using var input = File.OpenRead(inputPath);
using var permafrost = new PermafrostStream(input, "ThisIsTheP@$$w0Rd!");
using var gzip = new GZipStream(permafrost, CompressionMode.Decompress);
using var output = File.Create(outputPath);
int bytesRead;
while ((bytesRead = gzip.Read(buffer, 0, buffer.Length)) > 0)
{
output.Write(buffer, 0, bytesRead);
}
}
```
## Visulation of 1MB NULL values.
