lucidiot/NullSharp
lucidiot
/
NullSharp
Archived
1
0
Fork 0
A C# client to /dev/null As A Service.
This repository has been archived on 2022-08-04. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Erwan Rouchet bc13f4fb1b
Bump xunit.runner.visualstudio
2020-06-03 13:29:46 +02:00
NullSharp Prepare for NuGet 2019-04-08 03:55:35 +02:00
NullSharpTests Bump xunit.runner.visualstudio 2020-06-03 13:29:46 +02:00
.gitignore Initial commit 2019-04-08 00:23:25 +02:00
.gitlab-ci.yml Downgrade tests to .NET Core 2.1 2019-09-22 19:11:26 +02:00
LICENSE Initial commit 2019-04-08 00:23:25 +02:00
NullSharp.sln Add unit tests 2019-04-08 03:28:49 +02:00
README.md Add README 2019-04-08 03:55:28 +02:00

README.md

NullSharp

NullSharp is a C# API client for /dev/null As A Service that lets you delete data securely in the cloud.

Usage

The service has been implemented in this client as a write-only Stream:

using System;
using System.IO;
using NullSharp;

namespace MyProject
{
    class Program
    {
        static void Main(string[] args)
        {
            string password = "hunter2";
            var stream = new NullStream();
            using (var sw = new StreamWriter(stream)) {
                sw.WriteLine(password);
            }
            // Get rid of the local copy
            password = null;
            // ...immediately
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
    }
}

Offline usage

You may use the standard System.IO.Stream.Null, a special Stream that should write to nowhere; however, secure immediate deletion and end-to-end encryption are not guaranteed. You should only use this method when no other options are available and disclose the potential breach risks to your Data Protection Officer as it may not be GDPR-compliant.

Disclaimer

Do not use this in any actual application code, unless you are crazy, want to prank someone, or heavily confuse whoever will maintain your code in ten years.