From ec3a060b489292cd874d003be385761726dfa99e Mon Sep 17 00:00:00 2001 From: Lucidiot Date: Mon, 8 Apr 2019 03:55:28 +0200 Subject: [PATCH] Add README --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..20c607a --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# NullSharp + +NullSharp is a C# API client for [/dev/null As A Service](https://devnull-as-a-service.com/) that lets you delete data securely in the cloud. + +## Usage + +The service has been implemented in this client as a write-only Stream: + +``` csharp +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](https://docs.microsoft.com/en-us/dotnet/api/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.