Client-Side Encryption with Cloud Storage Integrator
Introduction
You might already know that the Cloud Storage Integrator toolkit provides numerous components which help you to connect your application with various cloud storage providers, but did you know that you can quickly add strong client-side encryption with just a few additional lines of code?
Client side encryption protects your data at rest in the cloud so even if another entity, or even the provider itself, were to read your data it would be encrypted and unusable. Only you will be able to access your data.
All of the components in the Cloud Storage Integrator toolkit have two properties, EncryptionAlgorithm and EncryptionPassword, which are used to configure client-side encryption. When you specify a password using the EncryptionPassword property, the component will automatically encrypt your data when you upload it, and decrypt it when you download it. The EncryptionAlgorithm property controls which encryption algorithm is used for the encryption.
Code Example
As mentioned, enabling client-side encryption in any of the Cloud Storage Integrator components is very simple. For example, imagine you had this code for the Dropbox component:
string dropboxPath = "/My Folder/sensitiveData.zip";
// Uploading
dropbox.LocalFile = "../MySensitiveData.zip";
dropbox.UploadFile(dropboxPath);
// Downloading
dropbox.ResourcePath = dropboxPath;
dropbox.LocalFile = "../MySensitiveData2.zip";
dropbox.DownloadFile();
If you wanted to enable client-side AES 256 bit encryption, you'd just add a couple of lines before you call UploadFile() or DownloadFile(), like this:
string dropboxPath = "/My Folder/sensitiveData.zip";
// Set the encryption password to enable client-side encryption/decryption.
dropbox.EncryptionPassword = "encryption password";
dropbox.EncryptionAlgorithm = DropboxEncryptionAlgorithms.eaAES;
// Uploading
dropbox.LocalFile = "../MySensitiveData.zip";
dropbox.UploadFile(dropboxPath);
// Downloading
dropbox.ResourcePath = dropboxPath;
dropbox.LocalFile = "../MySensitiveData2.zip";
dropbox.DownloadFile();
We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.