Naeon: A method for secure distribution of confidential data to an untrusted environment
By: Rene Smaal
Tags: Cloud Storage, Cybersecurity, Anti Ransomware Tool, Cryptography, Privacy

Naeon: A method for secure distribution of confidential data to an untrusted environment Rene Smaal Aug 16·18 min read

Abstract: The global datasphere has grown faster than we could imagine a decade or so ago, and will keep doing so in the years to come, at a rate we may have a hard time imagining today. In its report Data Age 2025 (1), the IDC stated that in the year 2025 the annual data generated worldwide will increase to 163ZB from 33ZB in 2018, which is equivalent to 446EB of data per day (2). Keeping control of this dazzling amount of data, and keeping it safe from both internal and external threats, raises a lot of challenges. This new digital landscape we now find ourselves in, where an exponential growth of data goes hand in hand with an ever growing threat of cyber attacks and data breaches, demands new techniques and ways of working to keep control over our data. Storing data ‘in the cloud’ solves at least the problem of data loss by physical causes like fire, flood, earthquake, or hardware malfunction. But it also introduces many new problems and challenges. In the case of commercial cloud providers for example, you can never be sure if your data is stored safely and securely. Think data leakage, data abuse, privacy snooping. A third party commercial cloud provider can shut your account down and take away all data at their whim, for whatever reason, rightful or not. They can decide to stop their services as they see fit. Or even go out of business altogether. So if integrity, security, confidentiality and long-term availability of your data is of any concern, entrusting them to a commercial cloud provider may not be your safest bet. This work aims to be a method, as well as a tool, for secure distribution of confidential data to any off-site storage environment, in such a way that its confidentiality, integrity and avail­ability remain guaranteed at all times, regardless of the trustworthiness and reliability of the chosen environment. In addition, it includes a quick, explorative sketch of a robust cloud platform that combines long-term availability with rigid security techniques, while at the same time being completely independent of a single authority.

Index Terms: access control, cloud storage, content-addressed storage, privacy, secure data access, symmetric key cryptography

I. Introduction

In December 2020, in the midst of the corona pandemic and subsequent lockdowns, cyber­criminals worldwide had begun to take shameless advantage of the situation by launching ransomware, phishing, vishing, and all the other attacks they could find in their trick boxes, aimed at security holes in the IT infrastructure of their targets. In the Netherlands, cyber attacks — more specifically ransomware attacks — started gaining public attention when institutions belonging to the crucial infrastructure, such as The Maastricht University of Netherlands and the Overijssel municipality of Hof van Twente were successfully targeted by ransomware attacks. And at the time of writing of this paper, Kia Motors America suffered a ransomware attack, and both the Amster­dam University of Applied Sciences (AUAS) and the University of Amsterdam (UvA) were hit by an unspecified cyber attack. In the December article The Worst Hacks of 2020, a Surreal Pandemic Year (3), Lily Hay Newman of Wired reported cyber attacks on SolarWinds, Twitter, Blueleaks, University Hospital Düsseldorf, Vastaamo and Garwin, all but one carried out in the second half of 2020. Datto, a provider of white-label cloud services for managed service providers (MSPs), published its global survey Datto’s 2020 Global State of the Channel Ransomware Report, based on the findings of 1,000 MSPs on the state of the cybersecurity landscape. The survey pointed out that small and midsize businesses (SMBs) remain top targets for ransomware attacks: nearly 70% of MSPs report SMBs have been hit with ransomware in 2020. And “while ransoms are pricey (~$5K), the real cost is in downtime and loss of productivity due to the time-consuming recovery that often follows an attack.” According to MSPs, 62% of their clients’ productivity was impacted by the attacks, and 39% mentioned that their clients even suffered from business-threatening downtime as a result (4). The stories of honest, hardworking enterpreneurs who, after falling victim to cyber criminality, were forced to shutdown their businesses and dismiss their loyal employees, are no less than heartwrenching. This may be just the tip of the iceberg, as there are no numbers on how many organizations that fell victim to said crimes opted to remain silent due to the fear of substantial reputational damage. There is no shortage of specialists in the field of cybercrime prevention, nor is there one in the field of damage control after the fact. Yet, despite of this, statistics keep showing a staggering increase of damage caused by data loss as a result of cybercrime. Prevention is better than cure, as the saying goes. But no matter what prevention measures are put in place, no matter what security policies are implemented, loss of critical data due to cybercrime (or any cause, for that matter) can never be completely ruled out. And when prevention fails, the cure may prove costly or, worse, even impossible. If prevention is not always the answer, and a cure not always attainable, what solution is there to think of, when our goal is to address the dangers of cyber attacks proactively? By the end of December 2020 we started a conceptualization process that, by mid-February, had resulted in a working proof of con­cept of such a solution. This proof of concept is, in essence, a safety net for exactly this type of situations, where both cybercrime prevention and -cure are out of reach. It is designed with the single purpose of ensuring the security and privacy of the data it processes by using some of the strongest cryptographic algorithms currently available, so that only you yourself will ever have access to it (5). Additionally, a sharding technique is applied, whereby the encrypted data is split up into a random number of chunks that are similar in size, time-stamped equally, and with hashed filenames that do not reveal any information about their content, nor about their concatenation order. Without knowledge of the latter, the number of possible permutations alone is such that even though all the chunks get stolen or compromised in any way or form, there is no way the attacker could successfully concatenate them into their original order to form a valid, decryptable file.

The rest of this paper is structured as follows. Section II is about Naeon, a data encryption and sharding method. Section III contains a rough sketch of the outlines of Naeon Pool, a blockchain-based, cooperative distributed cloud environment that is tailormade to host the output (chunks) of Naeon in such a way that long term availability, as well as quick, secure, reliable and easy access are guaranteed at all times, without being dependent of a single authority. Section IV contains a case study. It ends with a conclusion in Section V.

II. Naeon

In order to reduce the chances of data loss as a result of a cyber attack, backing up your data off-site is one of the primary foundations of good disaster mitigation policies. The term “off-site” in the context of data backups has become synonym with “the cloud” in recent years, and with it, the type of risks involved changed drastically. The traditional, physical, off-site data storage required no more than a trusted location, a safe environment. The cloud, on the other hand, is a virtual space in which the (potential) dangers looming are far more complex, impossible to predict, mostly unknown, and highly dynamic in nature. Once you upload your critical data to the cloud, you lose control over it. From that moment on, your data is in the hands of the chosen cloud storage service, and you can only hope that they have their security policies in check, and first and foremost that the service itself is to be trusted at all times. Even if you encrypted your data before entrusting it to a cloud service, there is always a possibility that one overlooked vulnerability exposes your data to prying eyes. It is therefore essential that you take the best possible security measures before you entrust your data to a cloud service, or any off-site storage for that matter.

Naeon is a working proof of concept, implemented as a free and Open Source Bash program under the terms of the GNU Affero General Public License as published by the Free Software Foun­da­tion (7). It addresses potential security threats to which all data are ex­po­sed before and after ‘they leave the building’ on the following levels:

Confidentiality

Confidentiality refers to the protection of data from unauthorized access or disclosure. The International Organization for Standardization (ISO) defines it as: “property that information is not made available or disclosed to unauthorized individuals, entities, or processes.” (8) Integrity

Integrity refers to the protection of data from unauthorized modification or destruction, or by the definition of the ISO: “property of accuracy and completeness.” (9) Data should be consistent as well as trustworthy over its entire life cycle, without it being altered in transit by unauthorized individuals. Availability

Availability refers to the protection of data from unauthorized disruption. The ISO defines it as: “property of being accessible and usable on demand by an authorized entity.” (10) It assures that your data can be accessed (only) by authenticated individuals whenever needed.

The following methods and techniques are used by Naeon in order to meet the highest possible standards of information security management:

1. Rijndael block cipher

Naeon uses the Advanced Encryption Standard (AES) 256-bit encryption algorithm — also known by its original name Rijndael — in combination with a 128 character passphrase, randomly generated from the alphameric set, generating a 256-bit encryption key which has 2256 possible combinations. An attacker would have to try most of these 2256 possible combinations before getting it right. This would take way beyond any human lifespan. (11)

2. Obfuscation

Standard symmetric encryption algorithms result into an encrypted file with a particular format, which contains the encryption key, and which can be identified, by the same algorithm or any other suitable decryption tool, as a valid, decryptable file by checking its properties, or by simply performing a decryption attempt. Both the fact that the encrypted file contains the encryption key, and the fact that the file can easily be identified as an encrypted file without ample effort, are potential vulnerabilities. Knowing that it concerns an encrypted file, or even worse, which algorithm was used for its encryption, is information that attackers shouldn’t be able to distil to begin with. Furthermore, storing the encryption key in an encrypted file that can be recognized as such, opens the possibility of a successful brute force attack. Naeon addresses both issues using the follo­wing two methods:

Making the encrypted file unidentifiable

Two blocks of random bytes are generated. The first block, the so called prepend block, randomly sized between 1 and 10,000 bytes that are indistinguishable from ciphertext, is prepended to the encrypted file, so that the encrypted file now starts with random bytes, instead of its original header. The second block, the append block, is then appended to the encrypted file. Just like the prepend block, it consists of random bytes, but other than the prepend block, its size is not random but calculated, so that the newly formed container (prepend block + original encrypted file + append block) can be split into equal parts of 10n bytes each.

Preventing the encryption key to be sent out with the encrypted data

The container, which now encapsulates the original encrypted data plus the prepend- and append blocks, is then split into a private chunk, and c equally sized public chunks of 10n bytes, where 100 ≤ c < 1000, and n is an integer where n ≥ 2. The private chunk contains the prepend block, the original header of the encrypted file including the encryption key, and the first part of encrypted data, up to the point where the first public chunk starts. The public chunks contain the rest of the encrypted data (the last public chunk also contains the append block) and are meant to be sent out. The private chunk stays with the user, and needs to be subject to proper key management.

3. Sharding and generalisation

The container is sharded into one private chunk and 100 to 1,000 equally sized public chunks. Each chunk, both the private and the public chunks, are then renamed with their SHA-512 hash values. A filename conversion table is created with the original chunk filenames (containing their concatenation order) and their corresponding SHA-512 hashes, so that the concatenation order can be restored during a future restore. The second generalisation step is to timestamp all chunks with the same time: January 1st 2020, midnight UTC. Now all public chunks are equally sized, have the same timestamp, and are named in a way (their hash value) that doesn’t reveal any information about their content, or about their concatenation order. Without knowledge about the concatenation order, concatenating 100 to 1,000 chunks in the right order is virtually impossible (6). Non-concatenated, individual public chunks, being isolated from their original context of an encryption file format, are no valid encrypted files, can therefore not be decrypted, with or without a key, and as a result are useless for any attacker.

An example Naeon backup flowchart is shown in Figure 1. Figure 2 contains a sketch of the Naeon backup- and restore protocol. A partial listing of the Naeon Master Key XML is shown in Figure 3. Figure 4 shows a sample output of Naeon in backup mode, securing all existing MySQL databases by first performing an ASCII dump.