Encryption For Organizations and Individuals
Encryption For Organizations and Individuals
Organizations
and Individuals
Basics of Contemporary and
Quantum Cryptography
—
Robert Ciesla
Encryption for
Organizations and
Individuals
Basics of Contemporary
and Quantum Cryptography
Robert Ciesla
Encryption for Organizations and Individuals: Basics of Contemporary
and Quantum Cryptography
Robert Ciesla
HELSINKI, Finland
v
Table of Contents
Digital Certificates�����������������������������������������������������������������������������������������������19
Public-Key Infrastructure (PKI) and Certificate Authorities (CA)��������������������������20
Web of Trust (WOT)����������������������������������������������������������������������������������������������21
More on SSL/TLS������������������������������������������������������������������������������������������������21
FIPS and Digital Signature Algorithm (DSA)���������������������������������������������������22
Have Some Standards for Goodness’ Sake���������������������������������������������������������22
In Closing������������������������������������������������������������������������������������������������������������24
vi
Table of Contents
Padding���������������������������������������������������������������������������������������������������������������45
Would You Like Some Salt with Your Data?���������������������������������������������������������45
Best Salting Practices�����������������������������������������������������������������������������������46
How About Some Pepper?�����������������������������������������������������������������������������47
Stretching Keys���������������������������������������������������������������������������������������������47
Cyclic Redundancy Check (CRC)�������������������������������������������������������������������������48
Modes of Operation���������������������������������������������������������������������������������������������48
Block Ciphers and Stream Ciphers����������������������������������������������������������������49
Electronic Code Book (ECB)���������������������������������������������������������������������������49
Cipher Block Chaining (CBC)��������������������������������������������������������������������������49
Counter Mode (CTR)���������������������������������������������������������������������������������������50
In Closing������������������������������������������������������������������������������������������������������������50
References����������������������������������������������������������������������������������������������������������51
vii
Table of Contents
viii
Table of Contents
ix
Table of Contents
x
Table of Contents
xi
Table of Contents
Entertainment����������������������������������������������������������������������������������������������183
Manufacturing���������������������������������������������������������������������������������������������183
World Politics�����������������������������������������������������������������������������������������������184
In Closing����������������������������������������������������������������������������������������������������������185
References��������������������������������������������������������������������������������������������������������185
xii
Table of Contents
xiii
Table of Contents
xiv
Table of Contents
In Closing����������������������������������������������������������������������������������������������������������245
References��������������������������������������������������������������������������������������������������������245
Index�������������������������������������������������������������������������������������������������277
xv
About the Author
Robert Ciesla is a freelance writer from
Helsinki, Finland. He has worked on many
video games on several platforms. He is the
author of Game Development with Ren'Py
(2019) and Mostly Codeless Game Development
(2017). Ever since finishing A Brief History of
Time by Stephen Hawking in middle school,
Robert has been fascinated by the world of
quantum mechanics. Robert's bachelor's
thesis in journalism took on some questions
on how to popularize the core concepts of
quantum physics and related fields. He has devoured most relevant books
in the field since and continues to explore this area of reality.
xvii
About the Technical Reviewers
Paul Love is the Chief Information Security
and Privacy Officer at a financial services
organization and has been in the information
security field for almost 30 years. He has
held information security positions at many
major organizations including Federal Home
Loan Mortgage Corporation (Freddie Mac),
Ernst & Young, Microsoft, Schlumberger, Ally
Financial, and Fifth Third Bank. Paul started
his information security career when he joined
the United States Marine Corps, where he
served for eight years, eventually achieving the
rank of Sergeant.
Paul holds a Master of Science in Network Security, has authored/
co-authored nine books on Information Security and Unix/Linux, and
has been the technical editor of ten books on Linux and Unix. Paul
holds multiple information security and privacy certifications, including
Certified Information Systems Security Professional (CISSP), Certified
Information System Auditor (CISA), and Certified Information Security
Privacy Manager (CISM); multiple privacy certifications including
Certified Information Privacy Professional/United States/Europe/Canada
(CIPP/US, CIPP/E, CIPP/C); as well as other technical and professional
certifications.
xix
About the Technical Reviewers
xx
Introduction
Cryptography may or may not sound like the sexiest of topics. However,
it's essential to nearly everyone plugged into the planetwide community
of the Internet. Whether you're working for Area 52 with a Top Secret
clearance or shopping online for some swanky items, many elements
of cryptography will be present. They not only take the form of virtually
unbreakable databases but also (barely noticeable) digital certificates,
passwords, PIN codes, and secured email.
As impressive as current-day cryptography is in its security and
computational effectiveness, what's behind the corner is even more so.
Quantum computing is well on its way. We can expect our world to be
profoundly impacted by this paradigm on several levels.
Ultimately, encryption and secrecy are not new phenomena. They
have been with us since the earliest days of recorded history, only in
more primitive ways. The continuing need for concealing information
tells us something about the world at large. I hope this book offers you an
understanding of just how big of a deal cryptography actually is.
Encryption for Organizations and Individuals is for the curious
layperson. Equations are therefore kept to a minimum. This book
is roughly divided into two parts: first, we explore contemporary
cryptography, and then we probe into its quantum sibling. I hope my book
equips you with the tools you need to take on the quantum computing
revolution with some confidence.
xxi
CHAPTER 1
C
lassical Cryptography
Let’s first define our main term. The word cryptography refers to the
science of transmitting messages which remain undecipherable to
often malicious third parties. It comes from the ancient Greek words of
kryptos, which stands for hidden, and graphein, which means “to write.”
Cryptography is valued by warring tribes, governments, and individuals
alike; as long as there remains the need for any kind of political action or
activism, cryptography will continue to thrive.
There are two other terms of relevance you should become familiar
with at this point: plaintext and ciphertext. The former refers simply to an
unencrypted message (e.g., “Hello! Apress is the best publisher!”), while
the latter covers encrypted messages, which appear nonsensical to those
not in possession of the decryption key(s).
Now, the first recorded instance of hidden messages dates back
to ancient Egypt, 1900 BC. A series of nonstandard hieroglyphs (i.e.,
characters in the Egyptian writing system) were discovered carved into
the walls of a tomb. Experts still argue whether these messages contain
any pertinent information or not; they may have been created with the
intention to amuse or confuse.
Clay tablets from Mesopotamia (its area corresponding with most
of modern Iraq, Kuwait, and some parts of Syria) indicate attempts at
concealing more “serious” information around 1500 BC. Many of the
tablets were found to be encrypted cooking notes. These are clearly
important state secrets and should never fall in the wrong hands: empires
have been known to collapse for less!
The mighty Romans of ancient times, too, were known to utilize
cryptography, creating a device called Caesar’s cipher. It simply involves
shifting the alphabet to a degree as agreed upon by two parties (e.g., using
a right shift of two letters so that A becomes C and C becomes E). Although
hardly representing the state of the art in encryption in 2020, many a
private communique was dispatched between Julius Caesar (100 BC–44
BC) and his allies using this technique. It didn’t hurt, of course, that most
of his enemies were illiterate.
In medieval times, the state of the art in cryptography was to be found
among the Arab people. A grammarian from Basra, Iraq, Al-Khalil (717–
786 AD), wrote a seminal work on hidden messages, entitled The Book of
Cryptographic Messages. His book is famous for its use of permutations
and combinations to list all possible Arabic words with and without
vowels.
2
Chapter 1 The First Era of Digital Encryption
Which is the most frequent letter in the example? That would be K with
five occurrences. The most common letter was E, right? Changing the K’s
to E’s results in the following:
3
Chapter 1 The First Era of Digital Encryption
Not much help you may think. However, let’s keep at it. The second
most frequent letter here is Z with three occurrences. As for the English
language, the second used letter is T. Let’s go with that.
4
Chapter 1 The First Era of Digital Encryption
5
Chapter 1 The First Era of Digital Encryption
video as well in this context. Digital steganography took off in the mid-
1980s and won’t be an abandoned practice anytime soon. State secrets and
classified military intelligence will continue to be distributed using this
method for the unforeseeable future.
6
Chapter 1 The First Era of Digital Encryption
7
Chapter 1 The First Era of Digital Encryption
8
Chapter 1 The First Era of Digital Encryption
Now, there are two widely used encryption approaches in the world
today (not to be confused with encryption algorithms, which are a separate
concept): symmetric and asymmetric (i.e., public-key cryptography). The
former uses a single key for both encryption and decryption of the data.
The latter uses two separate keys: one public and one private. With this
asymmetric approach, the public key is used to encrypt data, while the
private key is used for decryption. In a classic example, Bob uses Alice’s
public key to encrypt some data. Upon receiving it, Alice then uses her
private key to decrypt the contents.
Under most circumstances, it’s impossible to discover the private key
using the public key. Symmetric cryptography is known to be speedier if
dealing with large quantities of data. However, the asymmetric approach
provides additional security.
Now, a bit is the smallest unit of measurement in data sciences,
being represented by either one or zero. The strength of an encryption
standard is usually apparent in the amount of bits it carries. There are
encryption standards ranging from 40 to 256 bits and more. A couple of
these will be discussed next with more elaboration on them coming up
later in the book.
9
Chapter 1 The First Era of Digital Encryption
a = 5 (Alice’s choice)
A = ga mod p
= 65 mod 19 = 5
b = 2 (Bob’s choice)
B = gb mod p
= 62 mod 19 = 17
Now we calculate Alice’s and Bob’s secret keys in public without a care
in the world:
secretkeya = B a mod p = 175 mod 19 = 6
If both secret keys turn out identical, and they do, the key exchange
has been successful. The shared secret number in our example turns out to
be 6, which is also the base number. This is not always the case. Rather it’s
due to us using such small numbers in our example.
10
Chapter 1 The First Era of Digital Encryption
11
Chapter 1 The First Era of Digital Encryption
the newer algorithms. Microsoft, for one, did wisely write off Triple DES
from its Office 365 platform in 2019. Unfortunately, it does remain in use
in some electronic payment services, including the smart payment card
varieties of Visa and Mastercard as of 2020.
In Closing
After reading this chapter, you should have an understanding on the
history of cryptography and how it relates to current-day electronics. You
absorbed information on the following:
12
CHAPTER 2
A Medium-Length
History of Digital
Cryptography
Having taken a look at the basics of digital cryptography in the previous
chapter, we’ll now move on to some specifics of the topic. We’ll take
a gander at technology, which is both historically significant and still
relevant in the field today. We’ll also cover some important related
standards organizations and unlock several concepts crucial in the world
of cryptography.
Now, the RSA algorithm was first presented to the public in 1978 and it
consisted of all the factors public-key cryptosystems of today possess. RSA
stands for Rivest–Shamir–Adleman, based on the three inventors behind
it. The trio went on to win the prized ACM Turing Award for computer
science in 2002. The other two scientists, Ron Rivest and Adi Shamir,
have enjoyed long and successful careers in fields such as cryptography
and mathematics. Since 2000, RSA has been classified as patent-free. The
algorithm is used in several Internet-related technologies, including TLS
(transport data security) (i.e., online URLs that begin with https://) and
PGP-based email encryption.
The RSA algorithm derives a pair of keys based on two large prime
numbers. One of these keys represents the public key, while the other
is kept private. One cannot derive the private key from the public key.
However, if the two originally used prime numbers are known to a
malicious actor, the private key can be computed, hence making the
encryption unsafe.
As for prime numbers, they are natural numbers greater than ones
(1) that can’t be generated by the multiplication of two smaller natural
numbers. The following are all prime numbers: 5, 7, 17, and 23. The
following are not: 4, 8, and 10. As with many things in mathematics, there
are an infinite number of prime numbers out there in the universe(s). As of
2019, the largest known prime number is 24,862,048 digits long. Yes, that’s
only the amount of digits, not the number itself. Note: Nonprime numbers
(e.g., 4, 8, 10) are referred to as composite numbers.
Relatively prime numbers (i.e., coprimes) also exist; these are groups
of numbers that have a greatest common divisor of 1. For example, 3 and
4 are a duo of relatively prime numbers, but 2 and 4 aren’t. Coprimes are
actually a big deal in RSA as you will learn next.
14
Chapter 2 A Medium-Length History of Digital Cryptography
15
Chapter 2 A Medium-Length History of Digital Cryptography
The greatest common divisor is best derived using the basic Euclidean
algorithm. This method refers to the factorizing of the two numbers in
question and the multiplication of their common factors.
Here’s another example of the basic Euclidean algorithm as in how to
count the greatest common divisor. Let’s have some jolly good fun with
two composite numbers. The number 64 can be factored like this: 2 x 2 x
2 x 2 x 2 x 2. The other number we’ll pick, 1096, can be factored like so: 2 x
2 x 2 x 137. These numbers have three common factors (2 x 2 x 2). We can
discard the rest. Therefore, the gcd for this pair is 8, which is denoted as
follows:
gcd(64, 1096) = 8.
16
Chapter 2 A Medium-Length History of Digital Cryptography
Now, having just received c from our friend Bob, and wanting to
transform it into plaintext m, Alice will compute the following sequence:
m=cd mod n. Alice simply utilized her private key consisting of variables
d and n to achieve this. The decrypted message will be padded as per
the padding scheme implemented prior to encryption, so it needs to be
unpadded before plaintext m is usable.
17
Chapter 2 A Medium-Length History of Digital Cryptography
generation. RNGs in the context of RSA are programs that create prime
numbers that are supposedly impossible to guess at a later stage. This
is not the case, at least not 100% of the time, and has proven to be a
security issue for RSA, too.
Not many varieties of RNGs are in use and some predictability in them
has been discovered. Two groups of researchers from Europe and the
United States made a startling discovery in 2012: some 27,000 public RSA
keys offered no security. The researchers used several databases of these
keys, including those found at Michigan Institute of Technology (MIT) as
well as those provided by the Electronic Frontier Foundation (EFF). They
examined a total of 7.1 million public keys. However, it’s safe to say RSA
is still a safe cryptosystem at least over 99% of the time; it hasn’t been
anywhere near fully compromised. There are no practical reasons to
abandon it anytime soon.
Some of the issues with RSA’s security are actually found in the
hardware sector. A select few manufacturers of Internet-related hardware,
like routers and game consoles, seem to prefer flawed RNG software in
their products due to cost-related reasons. These devices are supposed to
provide encrypted wireless connections and/or other forms of security, so
they, too, rely on random number generators, which may or may not be
always up to the task.
Also, although very robust in security, RSA is a relatively slow method
for encryption of larger datasets. In fact, it’s often used simply to encrypt
passwords used in faster, symmetric algorithms such as the Advanced
Encryption Standard (AES) described in Chapter 3. For this purpose, at
least even RSA is perfectly suited for in 2020 and beyond. This approach is
sometimes referred to as hybrid cryptography.
18
Chapter 2 A Medium-Length History of Digital Cryptography
D
igital Certificates
Certificates are basically messages with the public key and identity of some
entity. This message is digitally signed by some other entity, such as a
certificate authority. Because the message is signed, it remains unalterable.
This very property ties a public key to an identity. Proper authentication
of the owner of a public key is of paramount importance. Literally
anyone can generate public keys and publish them under any name they
desire. Without proper measures, an impersonator can access encrypted
19
Chapter 2 A Medium-Length History of Digital Cryptography
20
Chapter 2 A Medium-Length History of Digital Cryptography
More on SSL/TLS
As mentioned, perhaps the most commonly encountered use of
certificates is to be found in the online realm of the SSL/TLS protocol.
SSL stands for Secure Sockets Layer and remains a popular way of
encrypting data online; TLS refers to Transport Layer Security and is
simply a newer and improved version of the same technology. A website
secured with SSL/TLS will result in an encrypted connection that is
very hard to eavesdrop on. You’re visiting a secure website if its address
begins with https instead of http.
On an algorithmic level, SSL/TLS can utilize one of several popular
encryption methods, including RSA and the DSA, as described next. As of
2020, you should stick to TLS as SSL is a deprecated standard.
21
Chapter 2 A Medium-Length History of Digital Cryptography
22
Chapter 2 A Medium-Length History of Digital Cryptography
23
Chapter 2 A Medium-Length History of Digital Cryptography
education and technology in the field. The IEEE produces over 30% of the
world’s literature in computer science, including cryptography, in the form
of over 100 peer-reviewed journals.
In Closing
By finishing this chapter, you hopefully have gained some knowledge on
how popular cryptosystems operate on a theoretical level. You absorbed
information on the following:
24
CHAPTER 3
26
Chapter 3 The AES and Other Established Cryptographic Technologies
27
Chapter 3 The AES and Other Established Cryptographic Technologies
For another example, 13 in decimal would be, you guessed it, 1101 in
binary, that is:
(13)10 = (1101)2
Note There are two concepts you might come across which should
be addressed at this point: the most significant bit (MSB) and the
least significant bit (LSB). The former refers to the first bit (i.e., the
leftmost) in a binary string as it yields the largest value. The latter,
which is found at the last digit in a binary string, only holds the value
of one (1) at most.
28
Chapter 3 The AES and Other Established Cryptographic Technologies
1 67,000 ÷ 16 4187 8 8
2 4,187 ÷ 16 261 11 B
3 261 ÷ 16 16 5 5
4 16 ÷ 16 1 0 0
5 16 ÷ 1 0 1 1
29
Chapter 3 The AES and Other Established Cryptographic Technologies
0000 0 1000 8
0001 1 1001 9
0010 2 1010 A
0011 3 1011 B
0100 4 1100 C
0101 5 1101 D
0110 6 1110 E
0111 7 1111 F
As for the reverse? Take the hexadecimal value of, say, CACA, which
also happens to be the name of a somewhat obscure Goddess in ancient
Roman mythology (look it up). Now, the only thing we need to do for
this type of conversion is to once again ogle at Table 3-3 and pick our
corresponding four-digit binary symbols for each hex symbol. So, CACA in
hex is 1100 1010 1100 1010 in binary. Simple, isn’t it?
C
lassifying Bits
Unless you’re familiar with the many units used in digital information,
you should take a peek at Table 3-4; it lists some terms which will be
visited and revisited many a time later in this book and in the world of
cryptography as well.
30
Chapter 3 The AES and Other Established Cryptographic Technologies
Bit 1
Nibble 4
Byte/octet 8
Word 16
Double word 32
Quad word 64
Kilobyte (KB) 8192
Megabyte (MB) 8388608
31
Chapter 3 The AES and Other Established Cryptographic Technologies
I mplementations of AES
The AES system is provided free of charge for any purpose, private or
commercial; the standard is not only made available for the US federal
government. Numerous popular software products utilize AES. These
include file compression tools 7-Zip, Roshal Archive (RAR), and WinZip.
We’ll go in depth into the vast world of AES-based software in the next
chapter. Also, processor giants Intel, and as of late AMD, include hardware-
based AES acceleration in many of their CPUs making cryptographic
operations faster than ever on their newer platforms. This hardware-based
acceleration technology is known as AES New Instructions (AES-NI).
Under ideal settings, AES-NI can make your cryptographic operations ten
times faster.
1
M. Arora: “How Secure is AES against brute force attacks?”, EE Times, 2012
32
Chapter 3 The AES and Other Established Cryptographic Technologies
Table 3-5. Some popular bit widths and their associated possible
number of keys
Bit Width Possible Number of Keys
33
Chapter 3 The AES and Other Established Cryptographic Technologies
34
Chapter 3 The AES and Other Established Cryptographic Technologies
35
Chapter 3 The AES and Other Established Cryptographic Technologies
1. SubBytes
2. ShiftRows
36
Chapter 3 The AES and Other Established Cryptographic Technologies
K
ey Expansion
In the first step, an algorithm called the key schedule is used to create a set
of round keys from the original key/password. AES uses a separate 128-bit
round key for each round and also creates one additional key.
AES key expansion is divided into the following substeps:
1 1 0
1 0 1
0 1 1
0 0 0
37
Chapter 3 The AES and Other Established Cryptographic Technologies
38
Chapter 3 The AES and Other Established Cryptographic Technologies
Figure 3-2. The shift rows step in AES. Notice how the first row
isn’t altered
These types of operators are called bitwise shift operators in the world
of computer science. They are used to shift binary data not only to the left,
but also to the right. Time for an example. Note: Left and right bit shifts are
often denoted with << and >>, respectively.
39
Chapter 3 The AES and Other Established Cryptographic Technologies
The binary string 0010 in decimal represents the number two (2).
In the first example, we performed a bitwise shift to the left by two bits,
resulting in the binary string of 1000. Converted into decimal, that would
result in the number eight (8). So, for one, a single bit shift left doubles a
variable’s value.
Next, we performed a single bitwise shift right on the same binary string
of 0010. This resulted in 0001, which is the number one in both binary and
decimal. Bitwise operators are universally used not only in cryptography, but
in virtually all programming situations due to their effectiveness; they tend
to be easy on the CPU and not eat a lot of resources.
MixColumns
All of the columns of four bytes are next transformed by the means of
matrix multiplication. This function takes as input the four bytes of one
column and outputs four completely new bytes, which replace the original
column. The result is another new AES state consisting of 16 new bytes.
This step is not performed during the last round.
40
Chapter 3 The AES and Other Established Cryptographic Technologies
Decryption in AES
Reaching the plaintext in a dataset encrypted in AES is relatively simple:
most of the preceding steps are reversed. However, the same S-box
used during the SubBytes phases during encryption cannot be used for
decryption; the said lookup table needs to have an inverted counterpart at
that point.
Now, here are the steps for decrypting in AES:
1. Key Expansion
3. Reverse ShiftRows
4. Reverse SubBytes
2. Reverse MixColumns
3. Reverse ShiftRows
4. Reverse SubBytes
41
Chapter 3 The AES and Other Established Cryptographic Technologies
First, be aware that hashing isn’t the same as encryption. A hash value is
more like a unique digital fingerprint for a file. In most cases they’re almost
impossible to reverse engineer and can thus be used for secure identification
of datasets. Simply put, a hashing algorithm creates a fixed-sized value
(i.e., a value that is always the same bit width, no matter of the input) out of
variable-sized data (e.g., collections of images, text files, or audio files).
The output of a hashing algorithm is sometimes called the message digest.
For example, the text string of Apress is a great publisher! becomes
the following (MD5 algorithm) hash value: 0503ff3cb7e1c6f28064e63fc
5efa0b1. The much shorter message of Hello! results in this hash: 952d2c
56d0485958336747bcdd98590d. Although the messages are of different
sizes, the hash values consist of the same amount of digits, that is, there’s
32 of them in these and any others (processed with MD5).
Collisions
In theory, no two hash values are the same: this is what allows for their
exceptional usefulness in digital identification. However, an undesirable
scenario in hashing exists where there are in fact two identical values; this
is known as a collision. Hash values are created using a variety of different
algorithms. An ideal hashing algorithm is one which doesn’t facilitate any
collisions to occur. In reality, some of them do not exactly fit these criteria.
Next, we’ll take a closer look at some of the most popular algorithms for
hashing purposes. For the purposes of this book, we don’t need to dwell in
the inner workings of hashing algorithms, but you should understand why
they’re needed.
42
Chapter 3 The AES and Other Established Cryptographic Technologies
43
Chapter 3 The AES and Other Established Cryptographic Technologies
44
Chapter 3 The AES and Other Established Cryptographic Technologies
P
adding
The term padding in cryptography refers to the adding of gibberish into
encrypted data. This often helps to further protect the plaintext messages
in encrypted datasets. There are several techniques for padding in the
current day. AES, for one, works with many of these varieties. Let’s take a
quick glance at some of the most popular methods.
Bit padding is used by the previously mentioned hashing algorithms,
MD5 and SHA; it involves adding an extra bit and possibly an arbitrary
number of zeros (e.g., 1000 00) to the end of a data block. The ANSI X9.23
standard uses a byte-sized approach, outputting random bytes after a
packet of data (as a reminder, one byte equals eight bits). Zero padding is
the elegant, but efficient approach of adding a random number of zeros
after data. Again, all padding techniques add to the security of encrypted
and/or hashed data.
45
Chapter 3 The AES and Other Established Cryptographic Technologies
46
Chapter 3 The AES and Other Established Cryptographic Technologies
Stretching Keys
A concept related to salting and peppering, key stretching refers to
enhancing the protection against brute-force attacks a weak key/password
offers by adding to the time it takes to enter/guess a password. This
basically works by feeding the original key into an algorithm which adds
a considerable amount of additional data into it, resulting in a so-called
enhanced key. This is usually a key of 128 bits in width or more. Since the
enhanced key is such a large piece of data, it’ll take the attacker much
more time and resources to discover it, increasing a system’s level of
security greatly.
47
Chapter 3 The AES and Other Established Cryptographic Technologies
Modes of Operation
Before ending this chapter, we will address an important part of
cryptographic solutions: modes of operation. We will revisit some of these
concepts later in the book from the context of the most popular operating
systems. These operating modes are not exclusive to AES; they can be
applied to any block cipher. Modes of operation are an important part of a
group known as cryptographic primitives, which refer to well-established
algorithms used as building blocks for secure systems.
48
Chapter 3 The AES and Other Established Cryptographic Technologies
49
Chapter 3 The AES and Other Established Cryptographic Technologies
In Closing
After finishing this chapter, you will have hopefully gained awareness of
the following:
In the next chapter we’ll go deep into the world of encryption software,
including methods included in popular operating systems as well as some
of the most relevant third-party products.
50
Chapter 3 The AES and Other Established Cryptographic Technologies
References
Oppitz, M., Tomsu P. (2018). Inventing the Cloud Century: How Cloudiness
Keeps Changing Our Life, Economy and Technology. Springer.
Leurent G. (2008) MD4 is Not One-Way. In: Nyberg K. (eds) Fast
Software Encryption. FSE 2008. Lecture Notes in Computer Science, vol
5086. Springer, Berlin, Heidelberg.
Barker E., Roginsky A. (2019). Transitioning the Use of Cryptographic
Algorithms and Key Lengths. NIST Special Publication 800-131A, revision 2.
51
CHAPTER 4
and 10 Terabyte ones, understanding the latter provides much more room
for your music, photos, and software. Let’s switch on a dweeby electron
microscope and take a good look at how bits are actually organized on a
hard drive and a solid-state drive, as it all relates to many facets of digital
cryptography.
In the context of hard drives, a sector usually refers to a physical
piece spanning 512 bytes (i.e., 4096 bits). This was, and to an extent
still is, the minimum storage unit on most of these devices. However,
newer generation hard drives using a technique known as Advanced
Format (AF) have their sectors set at 4096 bytes (i.e., 32,768 bits). Now,
a concept closely related to a sector is the block. These refer to anything
between a single sector and groups of sectors (e.g., you may have one
block which spans four sectors or one block which includes only one
sector). So, a block is an abstraction which represents the smallest unit
of storage on a storage device. Blocks are needed because an operating
system can’t possibly access all sectors on an individual basis: there’s
simply a limited amount of “handles” or IDs available in an OS for that
purpose. Using the block approach allows operating systems to support
larger drives.
The next generation of hard disks is the solid-state drive (SSD). Unlike
hard disks, these types of drives have no moving parts and are thus faster
and more energy-efficient. These storage devices utilize semiconductor
cells for their functioning instead of rotating physical disks. The smallest
unit of storage in an SSD is called a page. This generally refers to 4 kilobytes
of data (i.e., 4096 bytes or 32,768 bits). From an operating system’s and
a user’s perspectives, SSDs work the same as hard drives. As with hard
drives, an SSD’s data space is grouped into blocks by an OS enabling a
limited amount of file handles to access all of the drive.
54
Chapter 4 You, Your Organization, and Cryptographic Security
55
Chapter 4 You, Your Organization, and Cryptographic Security
The FAT file system (an abbreviation of File Allocation Table) is both
old and almost universally supported. Most operating systems can read
and write FAT-formatted devices (e.g., hard disks and USB devices) without
installing any additional software. This system does have its limitations.
For one, an individual file has the upper size limit of 4 gigabytes. As
of 2020, FAT is still on occasion used on memory cards among other
applications.
In 2006 Microsoft released the exFAT file system. It was well received
and became the de facto standard on SD memory cards, for one. Gone was
the file size limit of FAT; in exFAT, a single file can be up to 128 petabytes
in size (i.e., 1015). As of recent years, most operating systems have a robust
support for exFAT right out of the box.
The once-ubiquitous Mac OS Extended (HFS+) file system is
still quite widely in use due to literal decades of development and
proliferation. Starting its life in 1998, it was Apple’s main file system
until 2017 with the introduction of the Apple File System (APFS).
Although readable by most modern Windows OSs, disks formatted in
either HFS+ or APFS require special software to enable any writing/
saving functionality. One notable maker of such tools is Paragon
Software. They provide Apple-related disk access solutions for both
Windows and Linux environments.
56
Chapter 4 You, Your Organization, and Cryptographic Security
Apple’s HFS+ file system can be in most cases used on Linux without
special software, but that requires an extra step of configuration before you
can reliably both read and write HFS+ data on the Linux side of the fence.
So prior to using the disk in Linux, connect said device to your Mac and
enter the following command in the Terminal program:
This disables journaling on the disk and you should now have a
fully operable drive in Linux. Using devices formatted in Apple’s latest
file system in most Linux distributions (i.e., AFPS), however, requires
dedicated software.
57
Chapter 4 You, Your Organization, and Cryptographic Security
File Containers
One doesn’t need to encrypt entire disks; file containers are virtual disks
of arbitrary size that for an outsider look like single files full of nonsense.
Once a file container is created, it can only be accessed using the right
kind of software and, naturally, the correct key/password. Pretty much
all third-party cryptographic software suites provide the functionality of
creating these types of files in case you have a handful of sensitive data
(e.g., unflattering mankini or swimsuit photos) you want to conceal from
the world at large.
58
Chapter 4 You, Your Organization, and Cryptographic Security
59
Chapter 4 You, Your Organization, and Cryptographic Security
60
Chapter 4 You, Your Organization, and Cryptographic Security
*= Windows 10 only
61
Chapter 4 You, Your Organization, and Cryptographic Security
the former, you only get one look at this key: scribble it down carefully.
With its many strengths and few (addressed) issues, as of 2020 FileVault 2
is a good choice for smaller organizations and individuals. As always with
proprietary encryption software, a backdoor may be present for the US
government to sneak in through.
W
indows and BitLocker
Most recent versions of Microsoft’s Windows operating systems ship
with a versatile encryption tool called BitLocker. In addition to offering
a traditional password-based system, users can opt to authenticate
themselves on BitLocker using several hardware-based methods, adding
combinations of TPM and USB devices into a security solution (see
Table 4-3). In theory, the more measures you have implemented, the more
secure your system is likely to be.
62
Chapter 4 You, Your Organization, and Cryptographic Security
63
Chapter 4 You, Your Organization, and Cryptographic Security
Next, it’s time to choose a way for storing the recovery key. You’ll have
the alternatives of using your Microsoft account, saving the recovery key
to another USB device, saving it into a file, or printing it out on a piece of
paper.
We’ll now get to choose how much of the drive will be encrypted. You
can select to encrypt either only the files already in use or to cover the
entire hard drive. In general, the latter is the slower, but safer option.
It’s at this point when installing BitLocker on Windows 10 you get the
option of using the XTS-AES operating mode, referred on this screen as
New encryption mode. If you’re encrypting a movable storage device,
such as a USB-stick, it’s best to choose Compatible mode instead.
Finally, BitLocker will want to check your drive for errors and restart
Windows to begin the encryption process, which will run smoothly in the
background. If you need to get some work done or even shut down your
computer, you can do it safely even at this stage of BitLocker’s operation.
The preceding example, while providing us with a robustly encrypted
operating system, didn’t take into account the various hardware-based
security measures previously mentioned in the chapter. All of that will be
covered later in the book.
64
Chapter 4 You, Your Organization, and Cryptographic Security
LUKS allows multiple users to decrypt the master key. Unlike the other
two OS-based encryption approaches mentioned in this chapter, LUKS is
open source. Backdoors aren’t therefore an issue. This makes LUKS a great
choice for Top Secret tier material; only extraterrestrials and that guy with
peanut allergy in the cafeteria might be able to access disks encrypted with it.
Now, LUKS is potentially one of the safest system-wide encryption
techniques mentioned in this chapter, certainly more so than Apple’s or
Microsoft’s products, simply due to the transparency it offers. We’ll be
looking into LUKS with much more attention later in this book. For now,
it suffices you’re aware of it.
65
Chapter 4 You, Your Organization, and Cryptographic Security
BestCrypt by Jetico
Full-disk encryption (FDE) in Jetico’s line of products, called BestCrypt
Volume Encryption, gives you a choice of five encryption algorithms,
all running on their most secure mode of 256-bit keys and all operating
on XTS. While offering dual-operating system support (i.e., Windows
and MacOS), FDE in BestCrypt only supports hardware-based security
measures (i.e., TPM) for users of Windows. BestCrypt doesn’t have an FDE
product for Linux.
However, Jetico also offers a separate file container-based product for
Windows, MacOS, and Linux each; this is called the BestCrypt Container
Encryption.
In 2013, Jetico released the full source code for its encryption products
(i.e., the BestCrypt Development Kit); it’s very unlikely this software comes
with any backdoors. One could do a lot worse than to purchase a BestCrypt
license for their organization. A 21-day free trial is available on the Jetico
website as of this writing.
Download BestCrypt here: www.jetico.com.
DiskCryptor by ntldr
Although last updated in 2014, DiskCryptor is a stable and secure open
source solution for nearly impenetrable encryption. Made exclusively for
Windows, the software comes with AES and two other algorithms which
can also be used in tandem with each other.
DiskCryptor is highly optimized for Intel’s core line of processors, but
due to its design approach, it’s very fast on other types of CPUs as well.
The author of DiskCryptor quite correctly assumes that commercial
encryption solutions, while technically impressive, do have major issues.
Clunky interfaces aside, open source cryptography is ultimately the way to
go as we will see later in the book.
Download DiskCryptor here: https://diskcryptor.net.
66
Chapter 4 You, Your Organization, and Cryptographic Security
DriveCrypt by SecurStar
Advertised as “military strength encryption,” DriveCrypt’s 1344-bit key
strength sounds quite robust indeed. As for its algorithms, the software
offers about a half a dozen including AES and, rather interestingly, the
obsolete DES. How exactly the massive key strength is obtained is unclear,
but on paper DriveCrypt seems like a solid Windows-only encryption
solution. The software even features support for advanced steganography
(as discussed earlier in the book) which is the technique of hiding sensitive
data in plain daylight in the form of fake music files and the like.
As for backdoors, SecurStar remain adamant that these are not
included in their products. Based in Germany, their claim seems to
carry some heft as the country is quite comfortable with cryptographic
freedoms. This may or may not change in the future, and if it does,
SecurStar have vowed to “move the company accordingly.”
A free 30-day demo version of DriveCrypt is available as of this writing.
Download DriveCrypt here: www.securstar.com/en/drivecrypt.html.
e Cryptfs
Not a software suite per se, eCryptfs is in fact a complete cryptographic file
system for Linux. This solution is actually a so-called stacked file system,
which refers to eCryptfs co-operating with a Linux file system. It has been
a part of the Ubuntu distribution since version 9.04. It’s also included in
Google’s Chrome Operating System, which is a Linux variant.
eCryptfs adds cryptographic metadata into files, so that any encrypted
files can be easily transmitted between hosts. These files will be then
decrypted automatically should the proper key/password be in the Linux
keyring. eCryptfs utilizes the AES algorithm.
67
Chapter 4 You, Your Organization, and Cryptographic Security
As with most things Linux, eCryptfs is open source and not likely
to have backdoors. A tad complicated for beginners, this is a powerful
cryptographic tool in the arsenal of any organization in need of additional
reinforcement into their security regime.
Download eCryptfs here: https://ecryptfs.org.
ProxyCrypt by v77
Described by its author as a tool for “paranoids and advanced users,”
ProxyCrypt is a powerful open source encryption system. On offer are
three algorithms, including the 256-bit variety of AES. Available for
Windows only, ProxyCrypt is a somewhat obscure piece of software but is
both speedy and secure. It’s a great choice for a robust full-disk encryption
solution with features such as hardware acceleration and automatic key
stretching (a technique discussed in the previous chapter).
Although ProxyCrypt was first released in 2013, it is a command-
line tool, meaning it uses a sparse text-based approach. However, a free
graphical user interface is available, which makes the software more
appealing to beginners.
Download ProxyCrypt here: https://sourceforge.net/projects/
proxycrypt.
VeraCrypt by IDRIX
Based on the legacy of a once very popular cryptographic system,
TrueCrypt (2004–2011), VeraCrypt is an open source, feature-rich
encryption suite available for Windows, MacOS, and Linux. Extensively
audited and deemed to be without backdoors, you can use this fine piece
of software for either full-disk encryption or for container files.
68
Chapter 4 You, Your Organization, and Cryptographic Security
T utorial Time!
Knowing how much theory goes into encryption, it might surprise you how
comfortable much of current-generation cryptographic software is to use.
We’ll now create a secure file container which may or may not be your very
first one. For this task we’ll be using the outstanding VeraCrypt tool.
69
Chapter 4 You, Your Organization, and Cryptographic Security
70
Chapter 4 You, Your Organization, and Cryptographic Security
71
Chapter 4 You, Your Organization, and Cryptographic Security
72
Chapter 4 You, Your Organization, and Cryptographic Security
In Closing
After finishing this chapter, you will have hopefully gained awareness of
the following:
73
CHAPTER 5
Common Attacks
Against Cryptographic
Systems
As formidable and secure as a computer with strong encryption sounds,
there is literally an entire scientific discipline for breaking into such
systems. In this chapter we’ll take a look at many of these malicious
techniques designed for breaking into cryptographic systems. Also, we’ll
tackle many other cyberthreats which are not specifically related to
cryptographic environments, such as malware and network-based attacks,
as these often go hand in hand. We’ll also introduce some concepts
important for the topic at hand.
Remember, you don’t have to be an expert in cryptographic attacks
after finishing this chapter or book. It’s enough that you roughly know what
types of attacks are out there and how to defend against them. We’ll revisit
these threats in the next chapters.
76
Chapter 5 Common Attacks Against Cryptographic Systems
C
ryptanalysis
Cryptanalysis is the analysis of information systems in order to gain
information about potential hidden sets of data in these systems. The
aforementioned four attack models are part and parcel of cryptanalysis.
Modern cryptanalysis techniques date back to the early 1990s and they can
be split roughly into two groups: linear and differential. These techniques
will be discussed next. While both of them were originally devised to
thwart the now obsolete DES cipher (as discussed in Chapter 1), they are
still relevant to this day.
L inear Cryptanalysis
Cryptographer Mitsuru Matsui introduced linear cryptanalysis in 1993.
With this approach, a malicious actor seeks to find linear relations between
a few bits from the plaintext (i.e., the unencrypted dataset), the encrypted
message, and the so-called round keys we discussed in Chapter 3 in the
context of the AES algorithm. Linear cryptanalysis uses a known plaintext
attack model (see the “Cryptographic Attack Models” section earlier in this
chapter).
D
ifferential Cryptanalysis
Contrast to linear cryptanalysis, differential cryptanalysis is used not only
against block ciphers (e.g., AES) but also cryptographic hash functions.
This technique is usually attributed to cryptographers Eli Biham and Adi
Shamir sometime in the late 1980s. Differential cryptanalysis is a chosen-
plaintext attack model (see the “Cryptographic Attack Models” section).
Under this scenario we have access to the encrypted system, but not the
password.
77
Chapter 5 Common Attacks Against Cryptographic Systems
B
irthday Attack
When attacking hash values (as discussed in Chapter 3), a malicious actor
can choose to use the birthday attack. Let’s say a hash value is 64 bits in
length, so its possible values span 1.8x1019, a fairly large range. However,
after repeatedly evaluating a function with different input data, the exact
same output is expected to be obtained after only 5.1x109 instances of
input. If the attacker is able to find two different inputs that give the exact
same hash value, a collision event has occurred and the hash function in
question has been broken. Birthday attacks are in essence a form of the
brute-force attack, which we will get into next.
78
Chapter 5 Common Attacks Against Cryptographic Systems
79
Chapter 5 Common Attacks Against Cryptographic Systems
C
ontact Analysis
Related to frequency analysis as presented in Chapter 1, contact analysis
is an attack which examines which characters (e.g., letters or numbers)
precede or follow other characters. In any language (e.g., English), certain
characters share adjacency more than others.
Although mostly relegated to classical cryptography, contact analysis
can be utilized in some modern contexts as a type of ciphertext only attack
(see “Cryptographic Attack Models” section). Contact analysis is based
on conditional probability, in which an event becomes possible should a
certain condition be first met.
Best Countermeasure Against Contact Analysis:
80
Chapter 5 Common Attacks Against Cryptographic Systems
Heuristic Attack
A part of many cryptographic attacks, the heuristic attack simply consists
of a malicious actor using well-established password-enhancement
practices preferred by many. Users often opt to add numbers either to
the beginning or the end of their passwords, hoping it will make it more
resistant to attacks (e.g., “password” vs. “password123” or “123password”).
While somewhat better than a simple dictionary-picked password, a more
effective approach is to ditch the dictionary altogether.
Countermeasures Against Heuristic Attacks:
Man-in-the-Middle (MITM)
Man-in-the-middle is a type of attack where an attacker secretly delivers
and potentially tampers with the communications between two parties
who are unaware of said attacker’s actions. The malicious actor might be
able to fully convince either or both parties they are sending data to each
other. We are not only talking about tampering with mail or messages.
Man-in-the-middle attacks can take place on a binary level where, instead
of two human parties, an attacker can convince a device or system that he
or she is the legitimate party to send its data to.
There are two major defensive strategies against man-in-the-
middle attacks: authentication and tampering detection. Encrypted
systems with robust authentication (i.e., SSL/TLS) are virtually immune
to these types of attacks. The technique of tampering detection focuses
on anomalies in latency.
81
Chapter 5 Common Attacks Against Cryptographic Systems
Meet-in-the-Middle
Not to be confused with man-in-the-middle, a meet-in-the-middle
attack is used in environments where an encryption algorithm using
multiple layers and keys has been implemented. Put simply, in this type
of attack, a malicious actor targets both the plaintext and the ciphertext
simultaneously, hoping to “meet in the middle” of a dataset to decrypt it.
This is a known plaintext attack (see the “Cryptographic Attack Models”
section).
A mostly theoretical threat, meet-in-the-middle works best in
scenarios such as international or corporate espionage. It could be
described as the bigger, more cantankerous brother of the brute-force
attack. This type of attack is a good reason why ciphers like the Triple DES,
as robust as they sound, may not be ideal choices after all. Also, meet-in-
the-middle attacks can be difficult to detect; therefore, prevention is the
way to go.
Countermeasures Against Meet-in-the-Middle Attacks:
82
Chapter 5 Common Attacks Against Cryptographic Systems
83
Chapter 5 Common Attacks Against Cryptographic Systems
R
eplay Attack
A replay attack is a type of simple man-in-the-middle or eavesdropping
approach. This type of attack consists of a malicious party retransmitting
valid credentials into a system, thereby gaining access to it. In theory, a
replay attack can be therefore used to circumvent even the strongest of
encryption schemes.
Countermeasures Against Replay Attacks:
84
Chapter 5 Common Attacks Against Cryptographic Systems
R
ubber-Hose Attack
Perhaps the crudest type of cryptanalysis, rubber-hose attacks refer to
subjecting the owner of a key/password to coercion or physical violence
to extract said information. Cryptography isn’t always diplomatic. We’ll be
looking at legal aspects and the rights of password holders in Chapter 7.
Countermeasures Against Rubber-Hose Attacks:
85
Chapter 5 Common Attacks Against Cryptographic Systems
86
Chapter 5 Common Attacks Against Cryptographic Systems
Due to the nature and wide variety of SCA attacks, you’ll need a
plethora of defensive strategies to counter them successfully; you should
implement as many of these as you can. The following is an overview
of these techniques. They will be discussed in more detail in the next
chapters.
87
Chapter 5 Common Attacks Against Cryptographic Systems
88
Chapter 5 Common Attacks Against Cryptographic Systems
90
Chapter 5 Common Attacks Against Cryptographic Systems
91
Chapter 5 Common Attacks Against Cryptographic Systems
Malware
A portmanteau for “malicious software,” malware is simply any type of
software which causes harm to a system, from minor annoyances to taking
full control. Any organization, minor or major, can be taken down with a
clever enough malware. Now, there are numerous types of malware, some
of which we’ll go through next.
Trojan Horse
Named after the ancient Greek story, a Trojan horse is at first a
seemingly harmless piece of software which turns out to be bona
fide malware when executed. Often, Trojan horses are presented as
innocent or even useful downloads in the form of email attachments
from an unknown actor, a fake software update, or a fraudulent
advertisement on a website.
Not all Trojan horses are created by your average hackers; many
governments actually use them as a form of cyber-warfare and espionage.
Keylogger
Basically, this type of malware exists to collect users’ keystrokes to
gather usernames, passwords, or other information useful to the
attacker (such as financial information). Needless to say, this can
entail a whole host of issues from hijacked social media accounts to
online banking trouble. Most keyloggers are software-based, although
hardware-based units also exist. There are also some advanced ones
which actually use an open microphone and an acoustic analysis to
deduce which keys were pressed.
92
Chapter 5 Common Attacks Against Cryptographic Systems
Man-in-the-Browser (MITB)
This type of threat takes over a web browser using its potential
vulnerabilities. It’s a remote Trojan horse able to modify the contents of
web pages from the user’s perspective. Worst of all, an MITB is capable of
interfering with online bank transfers and the amounts of currency they
process. In fact, this type of attack is considered one of the worst threats to
secure online banking, since it’s often completely invisible to the user.
Boy-in-the-Browser (BITB)
A smaller-scale version of the man-in-the-browser attack also exists, called
the boy-in-the-browser attack. BITBs target visitors to specific malicious
websites. A type of malware is forcefully installed to change a user’s
computer’s network traffic to become a part of a man-in-the-middle attack
in the online realm. After the damage has been done, the program might
delete itself, making its detection nearly impossible.
Botnet
Consisting of a large number of connected devices and functioning online,
a botnet is in essence a centrally controlled “army” of said devices usually
used for malicious purposes. A bot refers to an infected computer or
smartphone. Botnets can yield a lot of digital leverage and can consists of
millions of bots; the user may not even be aware that his or her device has
been compromised. For one, email spammers love their botnets. Also, they
are used to distribute Trojan horses and other malware online.
Infected systems that are a part of a botnet are usually called zombie
computers.
93
Chapter 5 Common Attacks Against Cryptographic Systems
Phishing Attack
Whenever a malignant piece of software or website poses as a legitimate
party, it’s called phishing. A very popular type of cyber-scam, this kind of
attack is used to “fish” for usernames, passwords, credit card numbers, and
other sensitive data from unsuspecting users thinking they’re dealing with
genuine businesses.
General-purpose mass phishing aside, there are several more unique
techniques for this attack. Whaling refers to targeting high-profile targets,
such as politicians or corporate executives. This type of approach can take
the form of a well-written subpoena or other legal document and often
results in sensitive data or a hefty sum of money sliding into the hands of a
malicious actor. Any critical data obtained from a high-profile individual is
naturally worth quite a tad in the black market. Whaling is sometimes also
referred to as business email compromise (BEC).
94
Chapter 5 Common Attacks Against Cryptographic Systems
One of the biggest examples of whale phishing was the 2016 incident
when the then-presidential candidate Hillary Clinton’s campaign head
John Podesta was tricked to hand over his email account password
by malicious actors. The phishing email simply told Podesta his Gmail
account had been hacked (by actors in Ukraine, no less) and that he
needed to change the password – by clicking a detrimental link.
95
Chapter 5 Common Attacks Against Cryptographic Systems
Policeware
Many governments are known to spy on their citizens. There’s a
specialized type of software for this purpose which is often referred to as
policeware. Once installed on a citizen’s/suspect’s computer, it can be very
hard to detect and remove; many makers of anti-malware products may or
may not have co-operated with law enforcement to guarantee this.
Perhaps the first large-scale example of policeware was Carnivore
(later renamed DCS1000), devised by the FBI in the late 1990s and
used primarily for email surveillance. It consisted of a Windows-based
computer physically set up at a place of interest, usually at an Internet
Service Provider (ISP) server room.
96
Chapter 5 Common Attacks Against Cryptographic Systems
Rootkit
A very serious type of malware, rootkits mask themselves from the user –
and most anti-malware software. Rootkits can be either automated,
roaming the Internet looking for systems to compromise, or they can be
installed by individual actors for any type of malicious purpose.
Some notorious rootkits include Flame (discovered in 2012), which
was used for cyber-espionage in the Middle East, and ZeroAccess
(discovered in 2011), which infected two million computers to create a
massive botnet with them.
97
Chapter 5 Common Attacks Against Cryptographic Systems
Spyware
Closely related to policeware, spyware is pretty much the same thing – except
it’s usually coming from malicious, nongovernmental actors. Identity theft
thrives from this type of malware; a person’s identity and credit card numbers
are well sought after among cybercriminals. Spyware usually operates fully
covertly on an unsuspecting user’s devices.
Credit card numbers aside, things that spyware can leak include
usernames, passwords, financial records, and Internet browsing history.
For purposes of blackmail, these types of malicious programs are often a
cybercriminal’s first choice. According to the Federal Trade Commission
(FTC), even back in 2003 more than 27.3 million Americans had been
victims of identity theft of which a considerable portion was facilitated by
spyware.
98
Chapter 5 Common Attacks Against Cryptographic Systems
V
irus
A virus is a type of self-replicating malware which can spread rapidly
especially over online environments, potentially infecting tens of millions
of computers and other devices. As of 2020 (and up until now), most
viruses target Microsoft Windows operating systems. Since Windows is a
very popular choice for organizations of all sizes, viruses cause financial
losses of several billion dollars a year due to causing slowdowns, system
crashes, and many other time-consuming scenarios. It’s to be noted
viruses do not self-execute; a user has to activate them.
Computer viruses can be thought of as a form of semi-intelligent
artificial life. The first software program that ticks most of the boxes for
being a virus was The Creeper System written by software developer Bob
Thomas in 1971. However, the program did very little damage, simply
displaying the message “I’m the creeper: catch me if you can” on infected
computers of the time.
W
orm
Closely related to a virus is a worm, which is simply not only self-
replicating but also automatically spreading and self-executing type of
malicious software. Worms often spread through email and don’t need
any user interaction to activate themselves. They are among the most
dangerous form of malware (see Table 5-2).
99
Chapter 5 Common Attacks Against Cryptographic Systems
R
ansomware
As a combination of a Trojan horse and a forced encryption of one’s
computer, ransomware is extremely dangerous and almost impossible to
crack. Once the user executes an innocent-seeming file (i.e., the Trojan
horse), the malware encrypts the system and prompts the user to pay a
sum of money to have it decrypted (see Figure 5-2). Around 181.5 million
ransomware attacks took place in the first six months of 2018 alone.
100
Chapter 5 Common Attacks Against Cryptographic Systems
In Closing
After finishing this chapter, you will have hopefully gained awareness of
the following:
• The main four cryptographic attack models
In the next chapter we’ll take a good gander at how to create near
impenetrable contemporary systems using encryption and other approaches.
101
CHAPTER 6
Creating Extremely
Secure Encrypted
Systems
Like you may remember, in Chapter 4 we took a quick glance at
encryption solutions for three of the most popular operating systems
as of 2020: Microsoft Windows, MacOS, and Linux. In this chapter we’ll
not only expand on this topic, but also cover the best general security
measures available for these operating systems in detail. We’ll tackle
the best anti-malware and other related solutions of today, in both
software and hardware. After all, there’s no effective cryptography
without defensive technologies against every variety of serious
malware. Feel free to implement as many of these countermeasures as
you can.
Due to the possibility of backdoors, in this chapter we’ll also have a
focus on open source solutions for all software presented. Closed-source
encryption software will still be featured as it does have its uses, even
when/if backdoored.
104
Chapter 6 Creating Extremely Secure Encrypted Systems
most delicate data within secure file containers. These should be naturally
encrypted with open source solutions only, such as the much loved
VeraCrypt. A double layer of, say, BitLocker and file containers consisting
of another dose of 256-bit AES data is a tough nut to crack for any actor,
whether highly skilled and malicious or not.
Now, should one implement multilayer encryption, some practices
should be adhered to. For one, the passwords for each layer should be
completely different and under no circumstance share patterns in any
way. Also, weak algorithms for both encryption and hashing should
be steered clear of. These include the Digital Encryption Standard
(DES) in all of its varieties, as well as the SHA-1 and MD5. The public-
key mammoth that is the RSA algorithm, while not obsolete, doesn’t
represent the cutting edge in encryption any longer; it has some issues
in both security and performance. Some cryptographers suggest either
using RSA at its higher key sizes of 2048 bits (or more) or abandoning
it altogether. Remember, the cryptographic quantum revolution is
right around the corner as of 2020. Its first casualty may very well be
algorithms like the once-venerable RSA.
105
Chapter 6 Creating Extremely Secure Encrypted Systems
106
Chapter 6 Creating Extremely Secure Encrypted Systems
N
etworks and Routers
Like you probably know, an interconnected series of devices sharing
data using specific protocols constitutes a network. This can be a large
corporate solution consisting of thousands of devices or a small home
network consisting of exactly one router and a mere handful of devices,
usually including a desktop computer (i.e., a typical local area network,
or LAN). The Internet is basically one large network of servers and
clients.
Now, a router is an important piece of hardware which transmits
data between devices in a network. Website data, email, and other
information coming in from the Internet enter a router in the form of
data packets. All of these packets contain destination information (i.e.,
an Internet protocol address or IP address) which naturally belong to the
device which made the request. Within a matter of seconds, these data
packets find their way from the Internet into the router, which directs
them toward a connected device.
There are a few important settings in routers which you need to pay
close attention to; if such a device is compromised, it can infect a whole
network, after all.
107
Chapter 6 Creating Extremely Secure Encrypted Systems
108
Chapter 6 Creating Extremely Secure Encrypted Systems
109
Chapter 6 Creating Extremely Secure Encrypted Systems
110
Chapter 6 Creating Extremely Secure Encrypted Systems
Figure 6-2. A simple local area network using the NAT technique
111
Chapter 6 Creating Extremely Secure Encrypted Systems
112
Chapter 6 Creating Extremely Secure Encrypted Systems
113
Chapter 6 Creating Extremely Secure Encrypted Systems
114
Chapter 6 Creating Extremely Secure Encrypted Systems
115
Chapter 6 Creating Extremely Secure Encrypted Systems
IPv6
IPv4 is slowly being superseded by IPv6, a 128-bit specification with
approximately 340 undecillion (i.e., 340 followed by a whopping 36 zeros)
unique IP addresses. This should last us a while, unless we somehow
colonize numerous other planets in the very near future and the colonists
breed on them rather uncontrollably.
IPv6 looks something like this: 09f7:9cd0:0ed0:1538:0000:0000:7360:0090.
Compared to the quaint dot-separated four-octet notation of IPv4, this may
seem rather intimidating to us humans. However, we can at least remove
all leading zeros from IPv6 addresses, changing our example earlier to
9f7:9cd0:ed0:1538:::7360:90. That’s slightly more memorable.
During 2020, around 25–30% of the Internet was provided in IPv6
(Internet Society, 2020). These numbers are in flux due to the still
somewhat maturing technology. Organizations and individuals have been
increasingly provided with IPv6 support in both network devices and
operating systems since 1998. Dating back to Windows Vista, Microsoft
began offering IPv6 support out of the box, while on the Apple side of
town, the 2011 release of MacOS 10.7 Lion saw the same for Mac users.
Many modern Linux distributions, too, work beautifully with the new
protocol.
How soon the new protocol becomes omnipresent is down to
providers of online services. So far, some big players, including Google,
AT&T, and Facebook, have been involved in promoting the joys of IPv6 to
the masses. Thousands of major ISPs and web-based companies vowed
to enable IPv6 support permanently on the World IPv6 Launch Event,
organized by the Internet Society, in June of 2012.
Now, a much larger pool of IP addresses aside, IPv6 offers some other
great benefits over IPv4, too.
116
Chapter 6 Creating Extremely Secure Encrypted Systems
IPv4, data sent using IPsec with this older protocol was
sometimes blocked by firewalls, due to malware being
capable of piggybacking on these data packets. Not so
much with IPv6 IPsec.
• Speed. Due to IPv6 not needing any network address
translation (NAT), data communications over IPv6 tend
to be less congested. As a result, your Internet traffic
may feel slightly snappier, at least when using a fully
IPv6-compliant Internet service provider (ISP).
117
Chapter 6 Creating Extremely Secure Encrypted Systems
VPN access. OpenVPN is open source with a free Community Edition and
a paid Access Server version which provides additional features.
In theory VPNs are never a bad idea. There are some issues, however,
when it comes to states with less than amazing human rights records
spying on their VPN-powered citizens. Many paid providers of these
services maintain more or less thorough logs of their users’ activities.
A government opposed to specific opinions might demand access to
these logs disposing of the element of anonymity from the proceedings
altogether.
On the whole the benefits of implementing a VPN into your online life
outweigh the drawbacks. Even casual browsers benefit from the added
security it provides when using public Wi-Fi connections around cafés
and other establishments; such unsecured traffic can be eavesdropped
on rather trivially. Casual browsers aside, this is also important for both
political activists and businesspeople having their morning latte with
Wi-Fi. For a less critical purpose, VPNs can be harnessed to sidestep geo-
blocking in which a service, such as Netflix, limits geographic regions a
user is trying to connect from.
118
Chapter 6 Creating Extremely Secure Encrypted Systems
Nord VPN From 3.50 USD per month A promise of a “strict no logging policy,”
for a three-year plan kill switch, secures up to six devices,
over 5500 servers
Mullvad VPN 5 USD per month Easy setup, open source, over 500
servers
Express VPN 7.50 USD per month for a Over 3000 servers in 94 countries, 24/7
12-month plan tech support, immune to Google and
YouTube, etc. geo-blocking
Hotspot Shield 3 USD per month for a Over 3200 servers, 24/7 tech support
three-year plan
119
Chapter 6 Creating Extremely Secure Encrypted Systems
VPN in MacOS
As is the case with Windows, you may want to use manual VPN
configuration for your Apple computer(s). For modern versions of MacOS,
the process is as follows:
120
Chapter 6 Creating Extremely Secure Encrypted Systems
121
Chapter 6 Creating Extremely Secure Encrypted Systems
122
Chapter 6 Creating Extremely Secure Encrypted Systems
123
Chapter 6 Creating Extremely Secure Encrypted Systems
124
Chapter 6 Creating Extremely Secure Encrypted Systems
Windows-Security Musts
Encryption aside, you should stick to certain policies when it comes to looking
after the security of your devices running the Windows operating system. Let’s
review these first before proceeding into more cryptographic territory.
125
Chapter 6 Creating Extremely Secure Encrypted Systems
126
Chapter 6 Creating Extremely Secure Encrypted Systems
127
Chapter 6 Creating Extremely Secure Encrypted Systems
In these older systems, you can usually enter BIOS settings by holding
down either the delete or F2 key. Navigate to the page mentioning TPM
and set it to “enabled”.
Now, the closer we got to 2010, the more PC’s came out equipped with
technology known as Unified Extensible Firmware Interface (UEFI).
A replacement for BIOS, a UEFI served the same purpose but offered
more features, improved boot-up speed, and additional security features.
For one, a UEFI-equipped computer is immune against many of the threats
BIOS had as a feature called secure boot mitigates a lot of them. However, a
UEFI makes installation of other operating systems than what a computer
came shipped with a tad inconvenient. Still, if given a choice of either
an older, BIOS-equipped PC or one with UEFI, the latter is a far better
bet from a security standpoint. Again, you should make sure your UEFI-
equipped computer has its TPM setting on “enabled” at all times; it may or
may not default to this setting out of the box.
128
Chapter 6 Creating Extremely Secure Encrypted Systems
SHA-512, and even the most rugged varieties of the SHA-3 family. Using
TPM 2.0 simply makes sense. However, not all TPM-devices are built equal
and the algorithms they support may vary. Again, read the specs before
investing in a computer.
You might have the option of using non-Microsoft drivers for your
TPM. This might prove to be an issue at some point; it’s best to
stick with certified Windows-based drivers. Also, with Windows 10
it’s better to not utilize any TPM-clearing function found in the UEFI
interface. Rather, let the operating system take care of that.
129
Chapter 6 Creating Extremely Secure Encrypted Systems
130
Chapter 6 Creating Extremely Secure Encrypted Systems
M
acOS-Security Musts
Whether you are an individual or in charge of an organization, there are
certain policies related to security you should always implement. Needless
to say, these approaches should have the scope of every single computer
under your roof.
131
Chapter 6 Creating Extremely Secure Encrypted Systems
132
Chapter 6 Creating Extremely Secure Encrypted Systems
Figure 6-6. The MacOS user settings screen. Note Login Options in
the bottom left
133
Chapter 6 Creating Extremely Secure Encrypted Systems
134
Chapter 6 Creating Extremely Secure Encrypted Systems
Not sure if a particular Mac has the T2 chip or just feel like perusing
some information concerning one? Open About this Mac and click
System Report. Select the Hardware tab. If it has a subtab called
Controller also mentioning the chip, you’re in luck.
135
Chapter 6 Creating Extremely Secure Encrypted Systems
• Encrypto by MacPaw
136
Chapter 6 Creating Extremely Secure Encrypted Systems
137
Chapter 6 Creating Extremely Secure Encrypted Systems
C
ryFS
Offering pretty much a complete cryptographic solution, CryFS is a
wonderful piece of open source software for most distributions of Linux.
Not only does it protect local data on your computer, but it can also be
harnessed for cloud-based services, such as DropBox. CryFS makes sure
only encrypted data leaves your system. This encompasses not only your
files and directories, but metadata (including file size information) as well.
The encryption approach in CryFS actually consists of a double-layer
process. First, it uses the most robust algorithm we currently have, the
AES-256, for an external layer. After this the user can choose to implement
a different encryption scheme for an inner layer. Both of these layers share
the password given by the user. A truly unique solution, CryFS is highly
recommended for more advanced cryptographers looking for the current
state of the art in Linux security.
Let’s now go through the basic steps of getting CryFS running on your
Linux distribution, shall we?
138
Chapter 6 Creating Extremely Secure Encrypted Systems
F ireStarter
Nearly all Linux distributions come with iptables, a piece of software which
functions as a firewall. Being a command-line utility, it can be hard to
grasp by beginners and can actually cause major issues with security and
connectivity if poorly configured. Luckily graphical user interfaces for this
vital part of Linux security do exist. One of the more established ones is
FireStarter, a free and intuitive firewall interface which works great for the
less experienced users.
139
Chapter 6 Creating Extremely Secure Encrypted Systems
140
Chapter 6 Creating Extremely Secure Encrypted Systems
While individuals can gain much peace of mind from Avast’s free tools,
the company offers even more value to corporations and organizations.
For one, Avast Business Antivirus Pro offers great additional features such
as secure file shredding and real-time data protection for teams working in
Microsoft’s SharePoint environment (see Table 6-5).
141
Chapter 6 Creating Extremely Secure Encrypted Systems
142
Chapter 6 Creating Extremely Secure Encrypted Systems
143
Chapter 6 Creating Extremely Secure Encrypted Systems
B
itdefender Antivirus
In charge of a vast variety of high-quality products for a multitude of
systems, Bitdefender is a company with great credentials in computer
security solutions. Free products notwithstanding (including their
Virus Scanner for Mac found on Apple App Store), Bitdefender has to
offer some powerful paid suites for most of your online security needs
(see Table 6-7).
144
Chapter 6 Creating Extremely Secure Encrypted Systems
145
Chapter 6 Creating Extremely Secure Encrypted Systems
146
Chapter 6 Creating Extremely Secure Encrypted Systems
TDSS, also known as Alurion, was the second most active rootkit in
the world in 2010. The program did/does its best to disable all
anti-malware solutions on a system and gather sensitive data such
as credit card numbers and online credentials.
Stinger by McAfee
A fine addition to your anti-malware arsenal coming in at exactly zero
dollars, Stinger offers real-time protection in addition to its frequently
updated signatures. The program is available for users of both 32- and
64-bit Windows operating systems and does not need any kind of license
from McAfee to download or execute. Again, the main lure in Stinger is in
the real-time protection. McAfee does state this portion of the software
is still in beta testing as of 2020 Q2, but it seems to do its job rather well
already. While you shouldn’t rely on Stinger alone for your anti-malware
needs, it’s still a good addition to have in your arsenal.
147
Chapter 6 Creating Extremely Secure Encrypted Systems
I n Closing
After finishing this chapter, you will have learned the following:
In the next chapter we’ll be taking a breather from the technical side
of things and explore the many fascinating legal aspects surrounding
cryptography. For one, did you know being in possession of any type of
encrypted material in select countries may in itself constitute a crime?
Read all about it in Chapter 7!
R
eferences
Internet Society (2020): Measurement activities of IPv6 deployment.
Retrieved from: www.worldipv6launch.org/measurements
148
CHAPTER 7
Prohibitions and
Legal Issues
As exciting as cryptography can be, dabbling in it may also come with a
few rather unpleasant unforeseen legal ramifications – when dealing with
certain jurisdictions, that is. We’ll now take a gander at digital encryption
technology from the sometimes overlooked legal point of view. Starting
from the vast landmass called America, we’ll have covered most the
world’s cryptographic restrictions by the end of this chapter. Also, the
related matter of various categories of US privacy legislation are explored.
Cryptography is a hot topic; it’s a magnificent tool for both congenial
and malicious actors in the world. As you deepen your knowledge on the
subject, you’re bound to run into some landmark court cases – and the
associated legal terms. Should you need to brush up on your legalese, a
primer is to be found at the end of this chapter, for your convenience.
150
Chapter 7 Prohibitions and Legal Issues
151
Chapter 7 Prohibitions and Legal Issues
152
Chapter 7 Prohibitions and Legal Issues
153
Chapter 7 Prohibitions and Legal Issues
154
Chapter 7 Prohibitions and Legal Issues
155
Chapter 7 Prohibitions and Legal Issues
156
Chapter 7 Prohibitions and Legal Issues
157
Chapter 7 Prohibitions and Legal Issues
158
Chapter 7 Prohibitions and Legal Issues
159
Chapter 7 Prohibitions and Legal Issues
160
Chapter 7 Prohibitions and Legal Issues
the list of EU dual-use controls would probably increase the privacy level
of the average European citizen to some degree as it would make access
to these technologies harder for some intrusive non-EU nations. However,
some EU members, including Germany and France, seem to vehemently
oppose this proposed action. As of 2020, the debate is still ongoing.
161
Chapter 7 Prohibitions and Legal Issues
The so-called rogue states of Iran, North Korea, Sudan, and Venezuela
are the most strict about having foreign cryptographic materials on their
soil. Even certain operating systems might not be welcome in some of
these nations. Entering these countries as a tourist with a device that has
a, say, specific version of the Windows operating system with BitLocker
installed might itself prove to be an issue – even if you don’t possess any
data encrypted with it.
Now, the following paragraphs provide a look at some of the nations
with strict controls on the import of cryptographic technology. Some of
this data comes from the Electronic Privacy Information Center (EPIC), an
independent nonprofit research center in Washington, D.C., one of the
foremost authorities on the subject.
Algeria requires “all terminal equipment and radio-electric installation
which is intended to be connected to a public communications network,
made for the domestic market, offered for sale or distributed for free” to be
approved prior to import. This almost definitely includes cryptography-
related technology. The approval must be obtained from the Regulatory
Authority of Post and Electronic Communications under the Ministry of
Post, Telecommunications, Technologies and Digitalization.
In Belarus a license from the Ministry of Foreign Affairs or the State
Center for Information Security of the Security Council is required to import
or export cryptographic technology. Cryptography used by businesses may
be subject to additional scrutiny or limitations.
China needs you to apply for a permit from the Beijing Office of
State Encryption Administrative Bureau for any of your cryptographic
needs. As of January 1st 2020, the State Council Order no 273 requires
that the import and export of encryption products needs a license by the
National Commission on Encryption Code Regulations/State Cryptography
Administration. Also, be aware that electronics purchased from China may
or may not contain software which spies on its users.
162
Chapter 7 Prohibitions and Legal Issues
163
Chapter 7 Prohibitions and Legal Issues
164
Chapter 7 Prohibitions and Legal Issues
165
Chapter 7 Prohibitions and Legal Issues
166
Chapter 7 Prohibitions and Legal Issues
167
Chapter 7 Prohibitions and Legal Issues
or her very best to enter a system, naturally without causing any actual
damage to the business. The results of these processes may end up saving
your organization quite a bit of money in the long term and should be thus
prioritized high.
168
Chapter 7 Prohibitions and Legal Issues
169
Chapter 7 Prohibitions and Legal Issues
170
Chapter 7 Prohibitions and Legal Issues
171
Chapter 7 Prohibitions and Legal Issues
172
Chapter 7 Prohibitions and Legal Issues
In Closing
After finishing this chapter, you should be informed on the following:
The next chapter will take us into the world of quantum mechanics.
We’ll explore topics such as qubits and superposition. Excited? You
should be!
173
CHAPTER 8
Quantum Computing:
The Next Big
Paradigm
As well established and world changing as the digital revolution has been,
its days are numbered. The never-ending march of scientific progress will
deliver us a new paradigm in the very near future: quantum computing.
Its applications, while at first purely theoretical, will eventually cover
many aspects of our lives: communications, medicine, security, and
even world politics. In this chapter we’ll take a glance at some of the
ramifications of quantum computing before moving into specifics with
the chapters to follow.
176
Chapter 8 Quantum Computing: The Next Big Paradigm
Physically qubits can take the form of single electrons, pulled right out
of an atom. When left to their own devices, qubits contain probabilities
for delivering the value of one (1) or zero (0). Upon observation using a
powerful electron microscope, the qubit will stick to representing one of
those values; in quantum physics, the act of observation alone defines the
outcome.
Now, a vector is a quantity with direction and size. If you were to travel
north from your current location with the speed of, say, 12 km per hour for
an hour, that dataset would constitute a vector. Similarly, vectors are key
ingredients in specifying quantum superposition. Qubits are represented
using Bloch vectors. These are unit vectors (i.e., vectors with the upper
length of 1) used to indicate points within the Bloch sphere. The one/zero
state of the qubit is represented by the point where the vector collides with
the surface of the sphere. The Bloch sphere also represents a qubit’s phase
information using rotation around the Z axis.
177
Chapter 8 Quantum Computing: The Next Big Paradigm
In the Bloch sphere from Figure 8-1, the symbol θ (theta) represents a
point’s co-latitude with respect to the z axis, while the φ (phi) represents
longitude along the x axis, specifying a point in the sphere. States zero and
one are displayed as vectors ∣0 ⟩ and ∣1⟩ on the top and bottom areas of
the sphere, respectively. Make note of ∣ψ⟩ (psi): it’s there to represent the
superposition of these vectors/states.
178
Chapter 8 Quantum Computing: The Next Big Paradigm
Cryptography
One field perhaps most obviously revolutionized by the looming quantum
revolution will be cryptography. The world of sub-atomic particles offers
both powerful new levels of security and detrimental effects on the
integrity of current-generation encryption schemes, many of which will be
compromised. However, panic need not set in just yet. At least for the first
few generations, quantum-based computers are unlikely to do terminal
damage to encryption algorithms not based on prime numbers, such
179
Chapter 8 Quantum Computing: The Next Big Paradigm
Medicine
There is little doubt quantum computing will usher in a new era in
medicine. Medical simulations can be performed at speeds unheard of
until then. Unfazed due to the massive financial incentives involved, big
pharma will be happy to invest in quantum computing. New medications
will be introduced at a much faster rate due to greatly reduced time
needed on clinical trials. Medical schools will delight at the opportunities
provided by new resources and teaching methods. This works also in
reducing the costs of medical training from the students’ point of view in
some instances.
At some point virtual beings will be created; these will be equal to their
real-life counterparts for most, if not all, medical purposes. Operating on a
sub-atomic level, quantum-based technology will be introduced as a cure
for some illnesses considered terminal as of today. A massively accelerated
180
Chapter 8 Quantum Computing: The Next Big Paradigm
181
Chapter 8 Quantum Computing: The Next Big Paradigm
182
Chapter 8 Quantum Computing: The Next Big Paradigm
Entertainment
A boom in quantum-based entertainment is to be expected. Today’s
relatively sophisticated 3D video games will look crude compared to those
powered with processors dishing out several orders of magnitude more of
processing power. This may cause issues with addiction-prone individuals
as a new lifelike wave of immersive entertainment will no doubt hook
many. New virtual and augmented reality applications in particular can
completely take over a vulnerable gamer’s life. If unchecked, such a
scenario might take a toll on the productivity, tax base, and overall stability
of afflicted societies. After all, as of 2020 countries like Japan and South
Korea continue to have a major problem with swathes of young people
dropping out and opting to play current-generation video games en masse
while contributing to society in a diminished manner. In a 2019 survey,
it was estimated that Japan has over 1 million unemployed recluses, or
hikikomori (Kyodo News, 2019). Also, according to Japan’s government-
run National Institute of Population and Social Security Research, one-
person households will reach a total 39% by 2040 (Osumi, 2018). With no
family to take care of, electronic entertainment is likely to play a big part in
a Japanese single person’s daily activities.
Manufacturing
There is no doubt quantum computing will revolutionize manufacturing.
The numerous applications of this technology include new power sources,
elaborate risk modeling, advanced robotics, and rapid calculations/
simulations of extremely high precision. All this may also result in less
strain on the environment as power consumption and waste management
in the manufacturing sector is eventually optimized, proving ecologically
superior to current approaches. We can expect a leap forward in industrial
design and product safety, too. As these are still the early years of
quantum-based computing, most businesses will be wary of jumping into
183
Chapter 8 Quantum Computing: The Next Big Paradigm
the fray. However, as more and more hungry startups and established
brands take on this technology, the temptation to go quantum will become
irresistible for even the most stubborn of companies; in the very near
future, the risks will become negligible, outweighed by benefits in every
metric.
World Politics
Sooner or later some serious political implications will arise when
considering all of the preceding effects of the quantum revolution.
Basically, quantum computing is the nuclear arms race of the twenty-first
century. The regime which develops the first fully functional quantum
system has the potential means to annihilate even the most secure of
encryption, such as the AES-256, in a matter of months instead of billions
of years as per classical computing devices. Espionage and related
paranoia will reach untold levels when this scenario unfolds. Of course,
belligerent nations in charge of a theoretical quantum supercomputer
are unlikely to advertise its existence until one day all of our banking
systems and state secrets are in jeopardy. In the wrong hands the quantum
revolution could even accelerate a global military conflict.
184
Chapter 8 Quantum Computing: The Next Big Paradigm
I n Closing
After finishing this chapter, you will have learned the following:
R
eferences
Kyodo News. 2019. Japan Times. Retrieved from: www.japantimes.co.jp/
news/2019/03/29/national/613000-japan-aged-40-64-recluses-says-
first-government-survey-hikikomori/
Osumi, Magdalena. 2018. Many of Japan’s growing number of singles
claim they are comfortable facing death alone. Japan Times. Retrieved
from: www.japantimes.co.jp/news/2018/06/14/national/social-
issues/many-japans-growing-number-singles-claim-comfortable-
facing-death-alone/
185
CHAPTER 9
The Rollicking
World of Quantum
Mechanics
Deepening one’s knowledge on quantum mechanics and related physics
paves the way for a greater understanding of the definite future of
computing and cryptography. Quantum mechanics is a branch of physics
focusing on the smallest scales known to us: the atomic and the sub-
atomic realms. It has numerous implications for our world, as discussed
in the previous chapter, and it comes with some controversy as well. We’ll
now go more or less clavicle deep into this sub-atomic level and explore its
numerous paradigm-shifting phenomena.
188
Chapter 9 The Rollicking World of Quantum Mechanics
189
Chapter 9 The Rollicking World of Quantum Mechanics
190
Chapter 9 The Rollicking World of Quantum Mechanics
191
Chapter 9 The Rollicking World of Quantum Mechanics
192
Chapter 9 The Rollicking World of Quantum Mechanics
193
Chapter 9 The Rollicking World of Quantum Mechanics
194
Chapter 9 The Rollicking World of Quantum Mechanics
Singularity Speculation
Inside the black hole lurks the mighty singularity. This is basically an
unknown region of infinite density as described by Einstein’s theory
of general relativity; the further inside you go, the more distortion in
space-time you would experience. Laws of physics break down inside
singularities (hence all the speculation about these things in science
fiction). However, there are some differing voices to the very existence
of this phenomenon; some scientists insist singularities as per Einstein’s
theories are flawed.
A new paradigm regarding black holes and their singularities is
emerging in the scientific community. This is known as loop quantum
gravity. Basically, this new theory introduces a new powerful repulsive
force which is able to counteract the pull of a black hole. Loop quantum
gravity isn’t a replacement for general relativity, rather, it builds on its
principles (Sholtis, 2019).
195
Chapter 9 The Rollicking World of Quantum Mechanics
196
Chapter 9 The Rollicking World of Quantum Mechanics
197
Chapter 9 The Rollicking World of Quantum Mechanics
Dark matter is not the same as dark energy, which is still a related
concept. Dark energy refers to another mostly theoretical force which
has been used to explain the accelerating rate at which the universe
seems to be expanding. Postulated by many scientists in the past,
this phenomenon was confirmed in 1998 by two award-winning
multinational research teams.
198
Chapter 9 The Rollicking World of Quantum Mechanics
199
Chapter 9 The Rollicking World of Quantum Mechanics
200
Chapter 9 The Rollicking World of Quantum Mechanics
201
Chapter 9 The Rollicking World of Quantum Mechanics
Figure 9-4. Phase relation visualized. The above two waves are in
phase, and below they’re out of phase
202
Chapter 9 The Rollicking World of Quantum Mechanics
Now it’s time to glance at the most relevant Planck units in some
detail to give you an understanding of why they are crucial to quantum
mechanics. Planck also formulated an important physics constant which
we’ll discuss first. Prepare yourself for an onslaught of Planck!
The exact value of the Planck constant has been refined and updated
over the decades. As of 2019, the value of this constant was fixed at
6.62607015x10-34 Joule seconds according to the National Institute
of Standards and Technology (NIST).
203
Chapter 9 The Rollicking World of Quantum Mechanics
204
Chapter 9 The Rollicking World of Quantum Mechanics
Quantum Entanglement
One of the most curious (and useful, from an engineering point of view)
properties of sub-atomic particles is known as quantum entanglement.
These particles can be made to share their quantum states, even when they
are physically far apart. This is one phenomenon that is firmly rooted in
modern physics and in some conflict with classical mechanics.
Entangled particles are a valuable resource for several applications.
Currently, quantum entanglement has been demonstrated to work for
distances up to 1200 kilometers. A satellite successfully relayed two
entangled photons to ground stations in 2017 (Juan, Yuan, Yu-Huai
et al., 2017).
205
Chapter 9 The Rollicking World of Quantum Mechanics
I n Closing
After finishing this chapter, you will have learned the following:
206
Chapter 9 The Rollicking World of Quantum Mechanics
In the next chapter we’ll take a few back steps and return to the world
of cryptography, now armed to our molars with new knowledge.
R
eferences
Newburgh, Ronald. 2001. Phys. Educ. https://doi.org/10.1088/
0031-9120/36/3/304
Hopkins, P. F., Hernquist, L., & Cox, T. J. et al. A Unified, Merger-driven
Model of the Origin of Starbursts, Quasars, the Cosmic X-Ray Background,
Supermassive Black Holes, and Galaxy Spheroids, The Astrophysical
Journal Supplement Series, Vol. 163, 2006
Klesman, Alison. What are primordial black holes? Astronomy
Magazine, 2019.
Sholtis, Sam. Beyond the black hole singularity, Penn State Science
Journal, Summer 2019
Samanta-Laughton, Manjir. Punk Science: Inside the Mind of God. O
Books, 2006
Racorean, Ovidiu. Spacetime manipulation of quantum information
around rotating black holes. Annals of Physics. Vol. 398, pp. 254-264, 2018.
Baudis, Laura. Direct dark matter detection: The next decade. Physics of
the Dark Universe, Vol. 1, issues 1-2, 2012.
Juan Yin, Yuan Cao, Yu-Huai Li et.al. Science 16 Jun 2017: Vol. 356,
Issue 6343, pp. 1140-1144
207
CHAPTER 10
Quantum Information
Science 101
The majority of this chapter will be devoted to logic-related side of
quantum-based computing in the form of logic gates and related
concepts. The four main quantum computing models will also be covered,
namely, quantum gate arrays, one-way quantum computers, adiabatic
quantum systems, and topological quantum computers. While not exactly
mainstream right now, quantum devices are well on their way. Absorb
this chapter well and you will stay ahead of the trajectory in these matters;
you’re reading about the near future with all its implications for you and/
or your organization after all.
L ogic Gates
To gain a better understanding of the various concepts and possibilities
quantum-based computing offers, we should visit some areas of classical
computing first. Let’s take a solid gander at logic gates. While originating
firmly in the era of classical computing, they are a relevant concept in the
world of quantum computing as well.
And what is the big deal about these logic gates? Basically, they are
the building blocks of any electronic device. Typically, voltage is fed into
a circuit, and as it traverses through logic gates, a variety of different
things can occur. A simple implementation of logic gates can be found
in electronic door buzzers. Although, say, microprocessors are much
more complex, these two types of devices still share some fundamental
similarities. A central processing unit (CPU) in a modern computer has up
to several billion logic gates, in the form of transistors, built-in. A transistor
refers to an electronic component which can either be used to amplify
signals or to act as a gate.
Now, XOR aside, there are several logical operations most electronic
devices, from digital watches to the latest gaming console, utilize. See
Table 10-1 for a demonstration of how the different logical operators work
on binary data.
210
Chapter 10 Quantum Information Science 101
211
Chapter 10 Quantum Information Science 101
212
Chapter 10 Quantum Information Science 101
213
Chapter 10 Quantum Information Science 101
In the light of all these no-go theorems, there are a variety of issues
in quantum error correction. Copying data, for one, is not an option.
However, quantum data can be spread between groups of qubits.
A promising approach in mitigating the issue is to be found in logical qubits.
These are basically collections of qubits serving as a single unit. This
provides a more robust and safeguarded level of processing data in a
quantum computer.
The previously discussed ECC uses the implementation of repetition
code rather extensively. Basically the technique entails resending data over
a channel until intact data makes it to the intended receiver. Classical ECC
repetition code doesn’t work with qubits, due to the no-cloning theorem.
However, quantum computers can sidestep this limitation with several
unique approaches and enjoy a reasonable level of fault tolerance.
One of the mightiest ways to provide sturdy quantum error correction
is known as Shor Code named after professor of applied mathematics
Peter Shor at the Massachusetts Institute of Technology. A Shor Code circuit
takes one logical qubit consisting of nine actual qubits. The approach can
correct any arbitrary errors occurring in a single qubit.
As mighty as the Shor Code is, there are other types of error-correcting
approaches in the quantum realm. Canadian physicist Raymond
Laflamme and his team developed a highly optimized code in which
an initial quantum state is processed with four extra qubits in state |0⟩,
therefore only requiring a total of five qubit units. The method is known as
Perfect Quantum Error Correcting Code (Laflamme et al. 1996).
214
Chapter 10 Quantum Information Science 101
215
Table 10-2. Some common quantum logic gates, their symbols, and matrix representations.
216
Imaginary units (donated with i) form some of these matrices, which are known as complex
matrices.
Chapter 10
Pauli-X X = (0 1 1 0 )
Pauli-Y Y = (0 − i i 0 )
Pauli-Z Z = (1 0 0 − 1 )
1
Hadamard H= (111 - 1 )
2
Swap SWAP = (1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 )
Quantum Information Science 101
æ 1 1 1 1 ö
√Swap SWAP = ç 10 0 0 0 (1 + i ) (1 - i ) 0 0 (1 - i ) (1 + i ) 0 0 0 0 1 ÷
è 2 2 2 2 ø
Chapter 10 Quantum Information Science 101
217
Chapter 10 Quantum Information Science 101
218
Chapter 10 Quantum Information Science 101
219
Chapter 10 Quantum Information Science 101
Oh, and, in case you’re wondering, eigen comes from German and
roughly translated means proper.
Pauli Gates
An important category of logical operators in the quantum world are
known as the Pauli gates, named after the Austrian theoretical physicist
Wolfgang Pauli (1900–1958). You might remember the Bloch sphere
representation of qubits we discussed in the previous chapters; Pauli gates
rotate a qubit in its three axes of x, y, and z.
These operators are simply called Pauli-X, Pauli-Y, and Pauli-Z. Of
these, the Pauli-X gate is the quantum equivalent of the classical NOT
operator: it reverses the (spin-)state of a particle switching spin-up to spin-
down or vice versa.
220
Chapter 10 Quantum Information Science 101
221
Chapter 10 Quantum Information Science 101
Table 10-3. The Toffoli and Fredkin gate circuit symbols and their
matrix representations
Gate Circuit Symbol(s) Matrix Representation
Toffoli
CCNOT =
Fredkin
CSWAP =
222
Chapter 10 Quantum Information Science 101
223
Chapter 10 Quantum Information Science 101
224
Chapter 10 Quantum Information Science 101
I n Closing
After finishing this chapter, you will have learned the following:
225
Chapter 10 Quantum Information Science 101
In the next chapter we’ll enter the fray of quantum encryption in full
force. And armed with all of this new knowledge, it’ll indubitably turn out
to be a winning fight for you, dear reader.
R
eferences
Perfect Quantum Error Correcting Code. Raymond Laflamme, Cesar
Miquel, Juan Pablo Paz, and Wojciech Hubert Zurek. Phys. Rev. Lett. 77,
198 (1996).
F. Delgado 2017 J. Phys.: Conf. Ser. 839 012014
Shi, Xiao-Feng. “Deutsch, Toffoli, and Cnot Gates via Rydberg Blockade
of Neutral Atoms.” Physical Review Applied 9.5 (2018).
Patel, Ho, Ferreytol et al. Science Advances, 2016: Vol. 2, no. 3, e1501531.
DOI: 10.1126/sciadv.1501531 https://advances.sciencemag.org/
content/2/3/e1501531
Childs, Farhi, Preskill 2001. Robustness of adiabatic quantum
computation. Physical Review A 65.1
Raussendorf, Briegel 2001. A One-Way Quantum Computer. Phys. Rev.
Lett. 86, 5188
Nature volume 434, pages 169–176 (2005)
226
CHAPTER 11
Quantum
Cryptography
In this chapter we’ll explore more of some of the most essential
components of quantum-based cryptography, including the grandparent
of quantum key distribution protocols, the formidable BB84. You’ll see
some familiar concepts and names, but you will probably also encounter
several new ideas.
B
B84
Developed all the way back in 1984 by Charles Bennett and Gilles Brassard,
the BB84 was the first cryptographic protocol that allowed legitimate
parties to detect eavesdropping during message transmission. It uses
Heisenberg’s uncertainty principle, which as you might remember from
Chapter 9 states that quantum-based data can’t be measured without
disturbing it.
The information sent using BB84 is encoded in the polarization of photons.
Polarization refers to the geometrical orientation of the oscillations in (light)
waves; the property is expressed in degrees, for example, 90° (see Figure 11-1).
Optical fiber is a typical carrier medium for this approach.
228
Chapter 11 Quantum Cryptography
229
Chapter 11 Quantum Cryptography
Table 11-1. A small sifted key. The plus sign denotes a rectilinear
basis, while X refers to the diagonal one
Adramicia-Alphonsine’s bit 1 1 0 0 0 1 1 1
Adramicia-Alphonsine’s basis + X + X X + X +
Adramicia-Alphonsine’s 90° 45° 0° 135° 45° 90° 45° 0°
polarization
Biniyaamzawed’s basis + X + X + X + +
Biniyaamzawed’s measurement 90° 45° 90° 135° 90° 45° 0° 0°
Shared bits 1 1 0 1
(i.e., the secret password/key)
230
Chapter 11 Quantum Cryptography
B92
Developed by Charles Bennett of BB84 fame, the B92 is basically an
optimized version of his previous protocol. Instead of four polarized states,
the B92 offers just two (Ouchao, Jakimi 2018). Transmission of the basis
(i.e., rectilinear or diagonal) used in the sifting stage is also not needed
in B92. While easier to implement than the BB84, the newer protocol is
thought to be less secure.
Figure 11-3. The three bases and six states of polarization of the SSP
represented with a Bloch sphere
231
Chapter 11 Quantum Cryptography
232
Chapter 11 Quantum Cryptography
In Closing
After finishing this chapter, you will have learned the following:
233
Chapter 11 Quantum Cryptography
In the next chapter we’ll delve much deeper into the fascinating theme
of quantum-based cryptography. There are still many concepts left to
unearth in quantum key distribution alone, for one.
References
B. Ouchao, A. Jakimi. International Journal of Advanced Engineering,
Management and Science, June 2018. Performance Evaluation of Secure
Key Distribution Based on the B92 Protocol.
Scarani, Bechmann-Pasquinucci et al. Rev.Mod.Phys. 81, 2009. The
Security of Practical Quantum Key Distribution.
Ilic, Nikolina J. Phy 334, 2007. The Ekert Protocol.
S. Rass, P. Schartner, M. Greiler. 2009 IEEE International Conference on
Communications. Quantum Coin-Flipping-Based Authentication.
234
CHAPTER 12
Quantum Key
Distribution Under
Attack
In this chapter we’ll continue on the emerging science of quantum
key distribution (QKD). This is a key technology and will undoubtedly
play a big part in many a person’s life in the near future. The concepts
introduced in the last chapter will be greatly expanded upon, including the
hardware side of things. But first, we’ll cover various types of QKD-focused
cryptographic attacks as these unfortunately will be an issue.
B
reaking QKD
Although representative of the next generation of computing, QKD is
not impervious to malicious activities. Some of these attack vectors
will resemble those found in classical computing. However, some
are only implementable in the world of quantum cryptography. The
attacks described next mostly target the BB84 protocol and its many
derivatives.
236
Chapter 12 Quantum Key Distribution Under Attack
Denial of Service
Instead of flooding a server with requests as is the case in a classical
denial-of-service (DoS) attack, in quantum-based settings malicious
actors can simply cut fiber optic cords. In the case of unsealed optical
quantum transmission devices, blocking the line of sight between these
units also does the trick. A quantum DoS is there primarily to disrupt any
proceedings and not to gather intelligence.
Trojan Horse
Its name notwithstanding, the Trojan horse attack in a quantum context
shares very little with its classical counterpart. Instead of a malicious
software package, the quantum-based Trojan horse uses the approach of
shining a bright beam of light into the quantum channel and examining
its back reflections. With only a handful of reflected photons, an
eavesdropper can deduce the basis choice of one of the legitimate parties
(Nitin et al. 2014).
237
Chapter 12 Quantum Key Distribution Under Attack
A variation of this attack known as the Intercept and Resend with Faked
States (IRFS) does not focus on guessing any original basis states. Instead
Eve’s emphasis is on producing pulses of light detectable by Bob. This
provides a cover for eavesdropping; Alice and Bob think they are operating
with unaltered quantum states, unaware of Eve’s influence on the
proceedings. This can reveal the full secret key/password without raising
alarm via spikes in the quantum error rate (Lizama-Pérez et al. 2016).
M
an in the Middle
A common type of attack in the classical world, man in the middle is also
a possibility during any unauthenticated use of QKD. In particular, the
calibration phase when establishing a QKD connection may be exposed
to this type of attack. By installing a malicious precondition into the
signal exchange, an eavesdropper may receive full details on the final key
(see Figure 12-1). The BB84 protocol and its derivatives in particular are
vulnerable to this attack (Fei & Meng, et al., 2018).
238
Chapter 12 Quantum Key Distribution Under Attack
239
Chapter 12 Quantum Key Distribution Under Attack
Component Breakdown
Next, we’ll go through the main components of the Tokyo QKD system;
Figures 12-2 and 12-3 show the basic parts of the transmitter and receiver
devices the network utilized. These will be discussed in detail.
240
Chapter 12 Quantum Key Distribution Under Attack
241
Chapter 12 Quantum Key Distribution Under Attack
242
Chapter 12 Quantum Key Distribution Under Attack
M
onitoring Detector
Implementing a monitoring detector (MD) into a receiver’s device helps
to ward off thermal blinding attacks. This optical power monitor receives
around 1% of the device’s input. This is enough to detect any suspicious
influx of heat energy typical in thermal blinding.
D
elay Line
An optical delay line (DL) is a component which protects against Trojan
horse attacks directed at the phase modulator (PM). The delay line makes
it impossible for a malicious actor to detect any reflected light from the
phase modulator unit before a modulated photon has been detected by
Bob/the receiver.
243
Chapter 12 Quantum Key Distribution Under Attack
T he Externals
All of this advanced technology is housed under a rather minimalistic
steel chassis as can be seen from Figure 12-4. Both the transmitter and the
receiver devices measure 19”/48 cm in width and 5.25”/13.3 cm in height.
1
I mage source: www.ncbi.nlm.nih.gov/pmc/articles/PMC5434053. Used under
Creative Commons 4.0 International License (https://creativecommons.org/
licenses/by/4.0/).
244
Chapter 12 Quantum Key Distribution Under Attack
I n Closing
After finishing this chapter, you will have learned the following:
R
eferences
Dixon, A. R., Dynes, J. F., Lucamarini M. et al. Quantum key distribution
with hacking countermeasures and long term field trial. 2017. www.ncbi.
nlm.nih.gov/pmc/articles/PMC5434053
Luis Adrian Lizama-Pérez, José Mauricio López, and Eduardo De
Carlos López. 2016. Quantum Key Distribution in the Presence of the
Intercept-Resend with Faked States Attack. Entropy/MDPI 19.
Yusheng Zhao. 2018. Development of Quantum Key Distribution and
Attacks against It. IOP Conf. Series: Journal of Physics: Conf. Series 1087.
Fabio Grazioso, Frédéric Grosshans. 2013. Photon-Number-Splitting-
attack resistant Quantum Key Distribution Protocols without sifting.
Physical Review A, American Physical Society.
J. Nitin, E. Anisimova, I. Khan et al. 2014. New Journal of Physics
16. Trojan-horse attacks threaten the security of practical quantum
cryptography.
B. Ouchao, A. Jakimi. International Journal of Advanced Engineering,
Management and Science, June 2018. Performance Evaluation of Secure
Key Distribution Based on the B92 Protocol.
Yang-Yang Fei, Xiang-Dong Meng, Ming Gao, Hong Wang & Zhi Ma.
2018. Quantum man-in-the-middle attack on the calibration process of
quantum key distribution. Scientific Reports volume 8.
245
CHAPTER 13
Implementations
of QKD
Chapter 12 provided a basic overview of the hardware components in a
quantum key distribution (QKD) system. We also explored the Tokyo QKD
Network built to test the threat resilience of QKD. In this chapter we’ll
delve into larger implementations of this technology, exploring the basics
of a total of five major QKD networks.
248
Chapter 13 Implementations of QKD
The nodes were all located within Vienna, apart from St Pölten (node 1)
which was hosted by a repeater station on a communication line from Vienna
to Munich, Germany (see Table 13-1).
249
Chapter 13 Implementations of QKD
250
Chapter 13 Implementations of QKD
251
Chapter 13 Implementations of QKD
SwissQuantum
Built to test the long-term performance of a QKD system, Swiss company
ID Quantique built the SwissQuantum QKD network in 2009. The system
ran for two years in the Geneva metropolitan area. SwissQuantum ran
between three nodes: the University of Genova (Unige), CERN, and hepia
(Haute Ecole du Paysage, d’Ingenierie et d’Architecture). Like its DARPA
counterpart, SwissQuantum ran on dark fiber cables.
SwissQuantum used a three-layered approach in implementing its
QKD network.
252
Chapter 13 Implementations of QKD
Not only limited to the world of audio, optical loss in fiber optic
sources is denoted in decibels (dB). A decibel is a relative unit of
measurement used in expressing the ratio of one value to another.
253
Chapter 13 Implementations of QKD
254
Chapter 13 Implementations of QKD
I n Closing
After finishing this chapter, you’ll have learned the basics of five recent
implementations of QKD networks, specifically DARPA, SECOQC, QUESS,
SwissQuantum, and the Tokyo QKD Network. See Table 13-3 for a rundown.
255
Chapter 13 Implementations of QKD
In the next chapter we’ll examine many other exciting technologies the
very near future holds for quantum-based computing and cryptography.
R
eferences
Elliott, C. The DARPA Quantum Network. 2004. Retrieved from
arXiv:quant-ph/0412029
Peev, M., Pacher, C., Alleaume, R. et al. The SECOQC quantum key
distribution network in Vienna. New Journal of Physics, Volume 11, 2009.
D. Stucki, M. Legre, F. Buntschu et al. Long term performance of the
SwissQuantum quantum key distribution network in a field environment.
New Journal of Physics, 13 123001, 2011.
Kramer, H. QUESS (Quantum Experiments at Space Scale) / Micius.
Retrieved from: https://directory.eoportal.org/web/eoportal/
satellite-missions/q/quess
Sasaki, M., Fujiwara M., Ishizuka H. et al. Field test of quantum
key distribution in the Tokyo QKD Network. 2011. Retrieved from
https://arxiv.org/abs/1103.3566
256
CHAPTER 14
Post-Quantum
Cryptography
For the last few chapters, we have kept a focus on quantum key
distribution, or QKD. This maturing technology is still going to be relevant
for a long time. What’s going to come with it is known as post-quantum
cryptography, which will be the main topic for this chapter. We’ll explore
an overview of this topic, going through the basics of the most relevant
approaches to encryption schemes in the post-quantum realm.
P
ost-Quantum Cryptography
To clarify, post-quantum cryptography (PQC) is a field of science in
which new quantum-resistant (mostly) public-key algorithmic solutions
are researched for a full variety of devices and scenarios. Quantum
cryptography, on the other hand, often refers to the use of quantum key
distribution (QKD) alongside contemporary encryption techniques, as
explained previously in the book.
Now, many classical cryptographic algorithms rely either on integer
factorization (e.g., RSA) or discrete logarithms (e.g., ElGamal). While
offering robust security within the current computing paradigm, the near
future may not be as bright for these approaches. Algorithms hazardous
to contemporary encryption schemes, like Shor’s algorithm, have been
Hash-Based Cryptography
Cryptographic primitives based on the security of hash functions
are generically known as hash-based cryptography. This variety of
cryptography is currently limited to digital signature schemes. The US
National Institute of Standards and Technology (NIST) announced in 2019
its intention to publish standards for stateful hash-based cryptography
based on Leighton-Micali Signatures (LMS) and eXtended Merkle Signature
Scheme (XMSS). We will look at both of these schemes soon.
258
Chapter 14 Post-Quantum Cryptography
259
Chapter 14 Post-Quantum Cryptography
260
Chapter 14 Post-Quantum Cryptography
Code-Based Cryptography
This branch of quantum-resistant cryptography relies on error correction
codes (ECC). Most basic cryptographic functions like encryption and
signing can be implemented using code theoretic concepts. From a
consumer’s point of view, optimized code-based cryptography can be
exceptionally fast during both data encryption and decryption, making it
ideal for mobile devices with limited battery life (Engelbert, Overbeck, &
Schmidt, 2007).
261
Chapter 14 Post-Quantum Cryptography
Multivariate Cryptography
Multivariate cryptography is a concept referring to asymmetric
cryptographic primitives based on multivariate polynomials. It represents
a very robust take on post-quantum cryptography. However, as most
of this technology hasn’t fully matured yet as of 2020, it’s feasible that
undiscovered attack vectors become an issue.
262
Chapter 14 Post-Quantum Cryptography
L attice-Based Cryptography
A lattice is a mathematical concept in group theory referring to repeating
sets of points. Lattices are coordinate vectors in an n-dimensional space
(see Figure 14-2). Perhaps the best real-life example of lattices in nature
comes in the form of crystals. The term n-dimensional space refers to a
vector space with an arbitrary number of vectors.
263
Chapter 14 Post-Quantum Cryptography
264
Chapter 14 Post-Quantum Cryptography
265
Chapter 14 Post-Quantum Cryptography
Homomorphic Encryption
With homomorphic encryption (HE), decryption is not actually necessary
to access any parts of encrypted datasets. This approach works well for
health and finance sectors as at no point is decryption necessary in the
traditional sense when operating on encrypted information. Critical
cloud-based storage is just one example of a scenario in which (fully)
homomorphic cryptography becomes highly useful. One notable feature
of lattice-based cryptography is known to facilitate fully homomorphic
encryption (FHE), the most robust form of homomorphism, particularly
well. However, homomorphic encryption can be implemented with
numerous public-key algorithms such as ElGamal and some of its
variations (Parmar, Padhar, & Patel et al., 2014).
266
Chapter 14 Post-Quantum Cryptography
267
Chapter 14 Post-Quantum Cryptography
Homomorphic Algorithms
There are a number of algorithms developed specifically for
homomorphism. We’ll review some of them next.
268
Chapter 14 Post-Quantum Cryptography
269
Chapter 14 Post-Quantum Cryptography
Standardizing PQC
As you probably know by now, encryption in its many forms is firmly
embedded in our world, from mobile devices to government databases.
A new generation of cryptographic technology must be therefore very
thoroughly evaluated before widespread implementation.
270
Chapter 14 Post-Quantum Cryptography
271
Chapter 14 Post-Quantum Cryptography
Commitment Schemes
Cryptographic primitives known as commitment schemes are often
used in tandem with the approach of zero-knowledge proofs. You can
think of a commitment scheme as firmly locked safe which is shipped
off to the receiver. It can only be opened if/when the sender gives
the combination to the receiver. Once locked, the message cannot be
altered even by the sender.
Commitment scheme operation takes place in two phases. First, in
the commit phase values are chosen. In the following reveal phase, the
value is both revealed and verified. Perhaps the most classic example of a
commitment scheme is known as coin flipping by telephone. For this we’ll
ask our old friends Alice and Bob to demonstrate.
272
Chapter 14 Post-Quantum Cryptography
In Closing
After finishing this chapter, you will have learned the following:
273
Chapter 14 Post-Quantum Cryptography
R
eferences
Johannes Buchmann, Erik Dahmen, and Andreas Hulsing. XMSS – A Practical
Forward Secure Signature Scheme based on Minimal Security Assumptions.
2011. Retrieved from: https://eprint.iacr.org/2011/484.pdf
Andreas Hülsing, Stefan-Lukas Gazdag, Denis Butin, and Johannes
Buchmann. Hash-based Signatures: An Outline for a New Standard.
Léo Ducas, Alain Durmus, Tancrède Lepoint, and Vadim
Lyubashevsky. Lattice Signatures and Bimodal Gaussians. 2013.
Daniel J. Bernstein, Daira Hopwood, Andreas Hülsing, Tanja Lange
et al. SPHINCS: practical stateless hash-based signatures. Eurocrypt 2015.
Retrieved from: https://eprint.iacr.org/2014/795.pdf
P. Q. Nguyen. Cryptanalysis of the Goldreich-Goldwasser-Halevi
cryptosystem from Crypto ’97. In Proc. of Crypto ’99, volume 1666 of
LNCS. IACR, Springer-Verlag, 1999.
Kipnis A., Shamir A. (1998) Cryptanalysis of the oil and vinegar
signature scheme. In: Krawczyk H. (eds) Advances in Cryptology —
CRYPTO ’98. CRYPTO 1998. Lecture Notes in Computer Science, vol 1462.
Springer, Berlin, Heidelberg
Engelbert, Overbeck, & Schmidt. A Summary of McEliece-Type
Cryptosystems and their Security. Journal of Mathematical Cryptology
Volume 1, Issue 2, 2007.
Kapshikar, Mahalanobis. 2020. A Quantum-Secure Niederreiter
Cryptosystem using Quasi-Cyclic Codes (v2). (ICETE 2018) - Volume 2
SECRYPT.
Au, Eubanks-Turner, & Everson. 2013. The McEliece Cryptosystem.
A. Ferozpuri and K. Gaj, “High-speed FPGA Implementation of the
NIST Round 1 Rainbow Signature Scheme,” 2018 International Conference
on ReConFigurable Computing and FPGAs (ReConFig), Cancun, Mexico,
2018. doi: 10.1109/RECONFIG.2018.8641734.
Erdem Alkim, Roberto Avanzi, Joppe Bos et. al. 2020. NewHope.
Algorithm Specifications and Supporting Documentation.
274
Chapter 14 Post-Quantum Cryptography
275
Index
A Application programming
interfaces (APIs), 270
Active Directory (AS), 43
Application-specific integrated
Adiabatic Quantum
circuits (ASIC), 241
Computer (AQC), 224, 225
Archaic black holes, 193
Advanced Encryption
Arrays, 25, 26
Standard (AES), 24, 25, 104
Avalanche photodiodes (APDs), 244
block sizes/key lengths, 33
column-major order, 34, 35
decryption, 41 B
implementation, 32 Basic Euclidean algorithm, 16
key expansion, 37 Basic Input/Output
row-major order, 34, 35 System (BIOS), 127
SPN, 34 BB84
stages Heisenberg’s uncertainty
add round key, 40 principle, 228
bitwise shift operator, 39, 40 key sifting, 229
MixColumns, 40 no-cloning theorem, 230
subBytes, 38 oscillations patterns, 229
symmetric encryption plus sign, 230
system, 32 polarization of photons, 228
XOR, 37 Beam splitters (BS), 242
Advanced Format (AF), 54 BestCrypt Container
AES New Instructions (AES-NI), 32 Encryption, 66
Albert Einstein’s theory, 189–191 Bimodal Lattice Signature Scheme
American National Standards (BLISS), 265
Institute (ANSI), 23 Binary to hexadecimal
Apple File System (APFS), 56 conversion, 29, 30
278
INDEX
Controlled-controlled-not D
(CCNOT) gate, 217, 222
DARPA Quantum Network
Counter Mode (CTR), 50
BBN Technologies, 247
Cryptanalysis, 77
SARG04 protocol, 248
Cryptographic attack models, 76,
universal hashing, 248
101
Data Encryption Standard (DES),
Cryptography
11–13, 23
Alberti disk, 6
Decibels (dB), 253
ballistic missiles and Decimal to binary conversion, 27
tanks, 150 Decimal to hexadecimal
Caesar’s cipher, 2 conversion, 28, 29
cipher-text, 2 Decoherence, 202
clay tablets, 2 Decoy state protocol, 236
congenial/malicious Denial-of-service (DoS), 237
actors, 149 Device Group ID (GID), 134
frequency analysis, 3–5 Differential cryptanalysis
Kerckhoffs’s principles, 6 BFA, 78, 79
landmark cases, 150 birthday attack, 78
nonstandard hieroglyphs, 2 contact analysis, 80
permutations and definition, 77
combinations, 2 evil maid attack, 80
physical/visual methods, 7 heuristic attack, 81
plaintext, 2 keylogger, 92
steganography, 5, 6 malware, 92
STO, 7 meet-in-the-middle attack, 82
transmitting messages, 1 MITM, 81
United States, 152 rainbow table, 83
Customs and Border related key attack, 85
Protection (CBP), 153 replay attack, 84
Cyber Intelligence Sharing and rubber-hose attack, 85
Protection Act (CISPA), SCA, 86–91
168, 169 Trojan horses, 92
Cyclic Redundancy Diffie–Hoffman key exchange
Check (CRC), 48 method (DH), 9, 10, 19
279
INDEX
280
INDEX
281
INDEX
282
INDEX
283
INDEX
284
INDEX
285
INDEX
U W
Unbalanced oil and Wave–particle duality, 199–201
vinegar (UOV), 262 Web of trust (WOT), 21, 24
Unified Extensible Firmware Wi-Fi Protected Access (WPA)
Interface (UEFI), 128 protocol, 109, 110
Unique ID (UID), 134 Windows-based system
Unitary matrix, 218 BIOS/UEFI/TPM, 127, 128
Universal Plug and Bitlocker, 126
Play (uPnP), 110 security mask, 125
Universal quantum gates, 217 TPM 1.2 vs. 2.0, 128
US federal legislation for TPM device, 129
privacy, 168 USB, 130
Wired Equivalent Privacy (WEP), 110
V
Variables, 25 X, Y
VeraCrypt XTS-AES operating mode, 64
cross-platform support, 72
encryption option, 71
installation, 70 Z
secure file container, 69 Zero-knowledge
Virtual private network (VPN), 117 proof (ZKP), 271–273
286