Book Image

Cryptography Algorithms

By : Massimo Bertaccini
Book Image

Cryptography Algorithms

By: Massimo Bertaccini

Overview of this book

Cryptography Algorithms is designed to help you get up and running with modern cryptography algorithms. You'll not only explore old and modern security practices but also discover practical examples of implementing them effectively. The book starts with an overview of cryptography, exploring key concepts including popular classical symmetric and asymmetric algorithms, protocol standards, and more. You'll also cover everything from building crypto codes to breaking them. In addition to this, the book will help you to understand the difference between various types of digital signatures. As you advance, you will become well-versed with the new-age cryptography algorithms and protocols such as public and private key cryptography, zero-knowledge protocols, elliptic curves, quantum cryptography, and homomorphic encryption. Finally, you'll be able to apply the knowledge you've gained with the help of practical examples and use cases. By the end of this cryptography book, you will be well-versed with modern cryptography and be able to effectively apply it to security applications.
Table of Contents (15 chapters)
1
Section 1: A Brief History and Outline of Cryptography
3
Section 2: Classical Cryptography (Symmetric and Asymmetric Encryption)
7
Section 3: New Cryptography Algorithms and Protocols
12
Section 4: Homomorphic Encryption and the Crypto Search Engine

A numerical exercise on a digital signature on secp256k1

In this section, we will deep dive into the digital signature of secp256k1 in order to understand the mechanism behind the operations of implementation and validation of the digital signature.

Suppose for instance that the parameters of the curve are the following:

p = 67 (modulo p)
G = (2,22)
Order n = 79
Private Key: [d]= 2

So, as we have chosen a very simple private key, it is just enough to perform a double point to obtain the public key (Q):

Q = d*G

In this case, we proceed to calculate the public key (Q). First, we will be using the following formula to calculate the double point:

t = (3XP^2 + a)/ 2YP
t = (3*2^2 + 0)/ 2*22= 12/ 44 = Reduce[44*x == 12, x, Modulus -> (67)] = 49
t = 49

Calculating Q = d * G using numbers implies replacing [d] and (G) with numbers:

Q = 2 *(2,22) 

Relying on the formula of the double point, let's find the coordinates of Q (x and y), starting with x:

xQ...