C#.NET Sample Application

Run demonstration test encrypt and decrypt calls with this sample application

Overview

This sample application will demonstrate how to encrypt and decrypt data using the different APIs.

Installation

Download the reference source from the GitLab repository, open the ubiq-dotnet.sln in Visual Studio.

For WinConsole project as the Startup Project: select WinConsole project as the Startup Project, select the Release Solution Configuration, Any CPU Solution Configuration, and then do a full Rebuild.

For CoreConsole project as the Startup Project: select CoreConsole project as the Startup Project, select the Release Solution Configuration, Any CPU Solution Configuration, and then do a full Rebuild.

Credentials file

Edit the credentials file with your account credentials created using the Ubiq dashboard

[default]
ACCESS_KEY_ID = ...
SECRET_SIGNING_KEY = ...
SECRET_CRYPTO_ACCESS_KEY = ...

View Program Options

For WinConsole:

Open a Windows command shell and change to the WinConsole executable folder:

cd WinConsole
bin\Release\WinConsole.exe --help

For CoreConsole:

Open a Windows command shell and change to the CoreConsole executable folder:

cd CoreConsole
dotnet bin\Release\netcoreapp2.0\CoreConsole.dll --help

From within the directory:

-e, --encrypt      (Default: false) Encrypt the contents of the input file and write the results to output file
-d, --decrypt      (Default: false) Decrypt the contents of the input file and write the results to output file
-s, --simple       (Default: false) Use the simple encryption / decryption interfaces
-p, --piecewise    (Default: false) Use the piecewise encryption / decryption interfaces
-i, --in           Required. Set input file name
-o, --out          Required. Set output file name
-c, --creds        Set the file name with the API credentials
-P, --profile      (Default: default) Identify the profile within the credentials file
--help             Display this help screen.
--version          Display version information.

Demonstrate

Demonstrate using the simple (-s / --simple) API interface to encrypt this README.md file and write the encrypted data to README.enc

For WinConsole:

bin\Release\WinConsole.exe -i README.md -o README.enc -e -s -c credentials

For CoreConsole:

dotnet bin\Release\netcoreapp2.0\CoreConsole.dll -i README.md -o README.enc -e -s -c credentials

Demonstrate using the simple (-s / --simple) API interface to decrypt the README.enc file and write the decrypted output to README.out

For WinConsole:

bin\Release\WinConsole.exe -i README.enc -o README.out -d -s -c credentials

For CoreConsole:

dotnet bin\Release\netcoreapp2.0\CoreConsole.dll -i README.enc -o README.out -d -s -c credentials

Demonstrate using the piecewise (-p / --piecewise) API interface to encrypt this README.md file and write the encrypted data to README.enc

For WinConsole:

bin\Release\WinConsole.exe -i README.md -o README.enc -e -p -c credentials

For CoreConsole:

dotnet bin\Release\netcoreapp2.0\CoreConsole.dll -i README.md -o README.enc -e -p -c credentials

Demonstrate using the piecewise (-p / --piecewise) API interface to decrypt the README.enc file and write the decrypted output to README.out

For WinConsole:

bin\Release\WinConsole.exe -i README.enc -o README.out -d -p -c credentials

For CoreConsole:

dotnet bin\Release\netcoreapp2.0\CoreConsole.dll -i README.enc -o README.out -d -p -c credentials