You are on page 1of 6

CHAPTER 2

LITERATURE REVIEW

The purpose of this chapter is to introduce a fundamental knowledge about the


cryptographic techniques and hashing algorithm to secure the information. Some early
examples of cryptographic techniques and their uses will be described in this chapter.

2.1. Fundamental Concepts of Cryptography


Kahate, A. [03Kah] described that human beings are always suspicious. When
a message is sent to someone, there is a suspicion that someone else will intercept it
and read it or modify it before re-sending. And this suspicion or doubt is not all
baseless. This is because, human beings are also nosy. There is always a desire to
know about a secret message being sent or received between two parties with or
without any financial or political gains. It is no wonder that the desire to send a
message to someone such that nobody else can interpret is as old as human history.
However, historical records available of this method (cryptography) date back to 2000
B.C. in Egypt, where hieroglyphics were used to decorate the tombs of dead rulers
and kings. These hieroglyphics narrated a story of the life of the king and talked about
the great acts of his life. The text has been deliberately cryptic, but not intended to
hide it. As time went by, these writings become more and more complicated and
therefore difficult to write as well as understand. Eventually, the practice died out. In
fact, for some period in history, cryptography was regarded as a mysterious and a
black art. It had developed a bad image. Chinese (e.g. Genghis Khan) did not use
cryptography very much. However, it is wide-spread and quite advanced in India
where the government used it to communicate with the spies. The famous Greek
drama, “Iliad” refers the usage of cryptography which was used when Bellerophon
was sent to the king with a secret tablet.
Dhany, H. W. [17Dha] pointed out that cryptography is a data security
technique to ensure data confidentiality, in addition to cryptographic understanding is
the study of mathematical techniques related to information security such as data
confidentiality, data validity, data integrity and data authentication.
5

To encrypt some information, there are a number of techniques that can use to
take something that is plaintext and turn it into ciphertext. The generation of ciphertext
from plaintext itself can be done in two basics, stream ciphers and block ciphers. In
2022, Villanueva J. C. [22Vil] presented that a stream cipher is an encryption
algorithm that encrypts 1 bit or byte of plaintext at a time. It uses an infinite stream of
pseudorandom bits as the key. For a stream cipher implementation to remain secure,
its pseudorandom generator should be unpredictable and the key should never be
reused. Stream ciphers are designed to approximate an idealized cipher, known as the
One-Time Pad. The One-Time Pad, which is supposed to employ a purely random
key, can potentially achieve “perfect secrecy”. That is, it's supposed to be fully
immune to brute force attacks. The problem with the one-time pad is that, in order to
create such a cipher, its key should be as long or even longer than the plaintext. In
other words, if the video file is 500 MegaByte that would like to encrypt, it will need
a key that's at least 4 Gigabits long. Clearly, while Top Secret information or matters
of national security may warrant the use of a one-time pad, such a cipher would just
be too impractical for day-to-day public use. The key of a stream cipher is no longer
as long as the original message. Hence, it can no longer guarantee “perfect secrecy”.
However, it can still achieve a strong level of security.
Villanueva J. C. also presented that a block cipher is an encryption algorithm
that encrypts a fixed size of n-bits of data which is known as a block at one time. The
usual sizes of each block are 64 bits, 128 bits, and 256 bits. So for example, a 64-bit
block cipher will take in 64 bits of plaintext and encrypt it into 64 bits of ciphertext.
In cases where bits of plaintext is shorter than the block size, padding schemes are
called into play. Majority of the symmetric ciphers used today are actually block
ciphers. DES, Triple DES, AES, IDEA, and Blowfish are some of the commonly used
encryption algorithms that fall under this group. 
The algorithm mode is a combination of a series of the basic algorithm steps
on block cipher. There are four important algorithm modes, namely, Electronic Code
(ECB), Cipher Block Chaining (CBC), Cipher Feed-back (CFB) and Output Feedback
(OFB).
The electronic codebook mode is the easiest mode of block ciphers. The
incoming plaintext message is divided into blocks of 64 bits each. Each such block is
then encrypted independently of the other blocks. For all blocks in a message, the
same key is used for encryption. At the receiver end, the incoming data is divided into
6

64-bit blocks, and by using the same key was used for encryption, each block is
decrypted to produce the corresponding plain text block.
Barakat, M. [18Bar] described that Ehrsam, Meyer, Smith and Tuchman
invented and patented in 1976 the cipherblock chaining mode. The main idea is to
make encryption contextual. The encryption of each block depends not only on the
key but also on the ciphertext of the previous block. If Initialization Vector (IV) is not
used for the start the first block’s encryption and decryption is just done in ECB
mode. A change of one bit in IV or in a plaintext block affects all following ciphertext
blocks. The problem is that due to this dependency of previous ciphertext blocks
encryption in CBC mode cannot run in parallel on a computer, it must be handled
sequentially. Decrypting with the correct key but a wrong IV affects only the
correctness of the first block of plaintext. All other blocks will be decrypted correctly.
This is due to the fact that for decryption only the previous ciphertext block is needed,
but not the decrypted previous plaintext block. It follows that decryption in CBC
mode can be done in parallel. Changing one bit in a ciphertext block causes complete
corruption of the corresponding plaintext block, and inverts the corresponding bit in
the following plaintext block. All other blocks stay correct. This fact is used by
several attacks on this mode. In order to make such attacks more difficult there is also
a variant of CBC called PCBC: the propagating cipher block chaining mode. which
also takes the previous plaintext block into account when encrypting and decrypting
the current plaintext block.
The main feature of CFB mode is that it is a so-called self-synchronising
cipher. If some part of the ciphertext is lost, the receiver only loses some parts of the
plaintext, but is able to correctly decrypt other parts after some amount of input data.
The errors do not propagate through the complete ciphertext. In particular, even if the
input vector is unknown only the first block cannot be decrypted. OFB mode is
extremely similar to CFB mode. The only difference is that in the case of CFB, the
ciphertext is fed into the next stage of encryption process. But in the case of OFB, the
output of the IV encryption process is fed into the next stage of encryption process.

2.2. Security Applications on Hashing Algorithms


Riadai I. [18Ria] observed that when the MD5 hash function is implemented
in the login mechanism of web-based application, it has weaknesses in the form of
collision attack that is likely to have the same hash value on two different input values
7

that can threaten the security and confidentiality of the data. Implementation of
password security in web-based applications requires updating to improve reliability
and ensure system security by using SHA-512 method. Testing is done by penetration
testing and user acceptance test (UAT). Testing after application of patch, the inputted
password has been converted to more reliable hash function using SHA-512 method,
and the result of UAT shows the result agreed and strongly agree with 86.00%, so the
implementation of the patch used to secure the password that was made during login
can run as required. Penetration testing has a purpose to show the resistance and
strength of each algorithm against brute force attacks. The testing mechanism is to
attack the resulting hash value by trying any combination to find the plaintext of the
hash. This test is done by using Hashcat tool that serves to get plaintext from a hash or
ciphertext. The result of this test is the comparison of time from which hash is faster-
found plaintext. In the brute force test, the data obtained from the experiment is the
time taken to obtain a plaintext that has been in the hash with MD5 takes an average
of 54 seconds while the time taken for hash with SHA-512 takes an average of 68
seconds. Based on the test it was found that the SHA-512 algorithm is better in terms
of durability and strength for brute force testing because it has a longer time to find
the plaintext of the hash value of the algorithm.
According to Megah M. [09Meg], the reliability of SHA-512 is achieved by
the ability to generate 512-bit hash values, which is the longest hash value that a hash
function can generate. This long hash value makes the SHA-512 more resistant to
attack than any other hash function so SHA-512 is considered a powerful, robust and
fast hash function.
Saltik, H. and Halil Saltik [22Sal] observed that SHA-512 algorithm is much
more complicated and safer than the other hash algorithms which can be SHA-256,
SHA-1, MD-5 etc. SHA-512 is more secure but SHA-256 is more commonly used by
blockchains, websites, or any other platforms which need security for databases.
Because SHA-256 is already enough for users’ security. SHA-256 works faster than
SHA-512 and SHA-256 already stands secure. The countless processes of SHA-512
makes SHA-512 more secure than SHA-256. For blockchain technology, SHA-512 is
not the recommendation. In Bitcoin, every money transfer transaction is announced to
the Bitcoin network. Bitcoin uses the SHA-256 algorithm to create and verify these
transfer transactions. Somebody tries to generate the key value for the created block,
those called “miners”. The cryptographic function that Bitcoin uses (SHA-256) is an
8

irreversible one. In order to find the input values of the function, it is necessary to
make countless attempts for giving the right input values to the system and that is the
only way to find input. Think about SHA-256, it has 2 256 unique hashing possibilities,
which is a huge number. If blockchain is a body, then miners would be its “muscles”.
Miners now trying to solve the encrypted transaction data which is encrypted by
SHA-256. Countless computers try countless inputs every second, even then it takes
10 minutes to find the right output. The king of muscularity, SHA-512’s unique
output possibilities are 2256 times of SHA-256. Think about how many times should
computers need to try all those combinations. That would be too slow and need too
much performance. The security that is going to unnecessarily have, won’t match the
performance and lost on blockchain mining.
In 2021, Kumar[21Kum] presented that a blockchain is a decentralized, digital
ledger that contains a systematic series of hashed blocks that are connected to each
other, hence the chain part of blockchain. These blocks contain data of various nature
for a certain purpose, such as customer banking information, patient details,
manufacture source traceability, secure ID, any secret information, etc. Each
transaction that takes place is stored in the block and added to the blockchain. These
blocks contain a list of growing records in the form of a distributed database.
Blockchain maintains the integrity of its data by validating each block with the help of
cryptography. Each participant in the specific blockchain validates the block. Data in
a blockchain cannot be modified without the approval of the participants. This is
known as proof-of-work. Each block in the blockchain contains the hash of the
previous block header within its header. This ensures that changing a single block in
the blockchain without detection is impossible. Modifying one block in the chain
requires generating new versions of every following block as well, increasing the
difficulty and helping to preserve the integrity of the blockchain’s digital ledger.
SHA-256 applies to building a block within a blockchain. The role of miners is to
process building blocks, that blocks are connected to a blockchain to build out the
nature of the Bitcoin blockchain. The block consists of a block number, data field,
cryptographic hash associated with it, and a Nonce. The produced hash is seen
as 00001acbm010gfh1010xxx. The hash starts with four leading zeros.  The four
leading zero’s confirm the validity of the block. The above hash is conforming to the
nonce, and the block number is corresponding to the available data. Since the hash has
four leading zeroes, therefore, it is a valid block. If any change occurs in the data
9

section, it will fully change the hash. If the newly generating hash does not have four
leading zeroes, then it will not be a valid block. To
make the block valid, the nonce field is to be changed.
Rhodes D. [20Rho] described that compared to the SHA-256 algorithm, the
adoption of the SHA 512 algorithm by blockchain projects has been very minimal.
Most blockchain networks that chose not to implement SHA-256 opted for other
hashing algorithms such as Scrypt, Lyra2REv2, Equihash, and CryptoNight. With that
being said, here are a few examples of networks that use or have used SHA-512.
Overall, other algorithms such as BitShares (BTS). Although there isn’t any
information available on the first blockchain project to implement SHA-512,
BitShares (formerly ProtoShares) was known as one of the earliest to do so.
According to the BitShares website, the network introduced the Momentum Proof of
Work (PoW) algorithm in October 2013. Momentum is a proprietary graph-based
algorithm that uses 512-bit SHA-1 (also known as Cuckoo Cycle). As one critique
stated, there were at least two clear issues with the BitShares implementation of
Momentum. First, the SHA-512 hash fails to take advantage of SHA-256 acceleration
instructions. Second, this implementation was found to be needlessly slow. Both of
these challenges meant ASIC miners would be able to succeed over CPUs and GPUs,
leading to network centralization issues.

2.2. Summary
In this chapter, the cryptographic techniques and their uses are discussed. And
this also includes the analysis of SHA-512 hashing algorithm. The background
theories will be presented in the next chapter.

You might also like