Lesson 18
PublicKey Cryptography
VIDEO: Symmetric Key and Public Key Encryption
Publickey cryptography
Introduction
Publickey cryptography is a class of cryptographic algorithms which requires two separate keys, one of which is secret (or private) and one of which is public. The public key is used to encrypt plaintext or to verify a digital signature; whereas the private key is used to decrypt ciphertext or to create a digital signature. The public key is widely distributed, while the private key is known only to its owner. The keys are related mathematically, but the parameters are chosen so that calculating the private key from the public key is either impossible or very expensive.
Publickey algorithms are based on mathematical problems (one way functions with trapdoor) which currently admit no efficient solution. They are inherent in certain integer factorization, discrete logarithm, and elliptic curve relationships. It is computationally easy for a user to generate their own public and private keypair and to use it for encryption and decryption. The strength lies in the fact that it is "impossible" (computationally infeasible) for a properly generated private key to be determined from its corresponding public key. Thus the public key may be published without compromising security, whereas the private key must not be revealed to anyone not authorized to read messages or perform digital signatures.
Problems of symmetric key encryption
Symmetrickey algorithms use a single secret key, which must be shared and kept private by both the sender and the receiver, for both encryption and decryption. To use a symmetric encryption scheme, the sender and receiver must securely share a key in advance.
Besides this, the amount of keys that have to be shared is growing exponentially, via the n(n1)/2 formula, where n is the amount of participants.
Symmetric cryptosystems don’t allow to achieve nonrepudiation, a property that requires that the sender of the message is uniquely identified. Since the symmetric key is shared between two parties, there is no way to prevent the sender of information from claiming at a later date that the information was never sent.
Usage of public key cryptography
There are three main uses for publickey cryptography:

Publickey encryption, in which a message is encrypted with a recipient's public key. The message cannot be decrypted by anyone who does not possess the matching private key, so only the owner can read it. Encryption is used to ensure confidentiality.

Digital signatures, in which a message is signed with the sender's private key and can be verified by anyone who has access to the sender's public key. Digital signatures are used to ensure authentication and nonrepudiation.

Key exchange, in which both parties communicate over an insecure channel to establish a session key.
Publickey cryptography is a building block for various Internet standards, such as SSL, TLS, PGP and others.
Because symmetric key algorithms are nearly always much less computationally intensive than asymmetric ones, it is common to exchange a key using a keyexchange algorithm, then transmit data using that key and a symmetric key algorithm. PGP and the SSL/TLS family of schemes use this procedure, and are thus called hybrid cryptosystems.
How it works: RSA
RSA stands for Ron Rivest, Adi Shamir and Leonard Adleman, who first publicly described the algorithm in 1977. It is based on the practical difficulty of factoring the product of two large prime numbers, the factoring problem.
The keys for the RSA algorithm are generated the following way:

Choose two random prime numbers p and q.

Compute n = pq. n is used as the modulus for both the public and private keys.

Compute φ(n) = φ(p)φ(q) = (p − 1)(q − 1) = n  (p + q 1), where φ is Euler's totient function.

Choose an integer e such that e and φ(n) are coprime. e is released as the public key.

Determine d as d ≡ e−1 (mod φ(n)); i.e., d is the multiplicative inverse of e (modulo φ(n)). d is kept as the private key exponent.
The public key consists of the modulus n and the public (or encryption) exponent e. The private key consists of the modulus n and the private (or decryption) exponent d, which must be kept secret. p, q, and φ(n) must also be kept secret because they can be used to calculate d.
RSA encryption is based on the fact that (me)d = m (mod N), where e – public key, d – private key, m  message. So the general idea is: To encrypt the message raise it to the power e, and to decrypt the ciphertext raise it to the power d.
Properties of information achieved with public key cryptography
Data confidentiality ensures that only authorised users can get access to the information.
Authentication is the process of confirming the identity of a message author.
Data integrity ensures that information is resistant to accidental and deliberate actions. This means that data cannot be modified in an unauthorized or undetected manner.
Nonrepudiation ensures that the initiator of a message cannot deny the fact of having sent a transaction.
Key distribution problem
While public key cryptography significantly simplifies key management, there are still some issues existing. The reason for that is that secure key distribution can be done using only these three techniques:

One to one meeting

Usage of the previously distributed key

Usage of a trusted party
Otherwise distributed keys are exposed to so called “man in the middle” attacks.
During this situation, the attacker impersonates the server for the victim, providing its own public key to the victim and viceversa  impersonating the victim to the server. Therefore the attacker is able to decrypt (and modify) all messages from the victim and the server without any risk of being noticed. Since this attack is able to affect such sensitive applications as internet banking, online payment services etc., protection has to be embedded into the operational system or so. One possible solution is Public key infrastructure (PKI).
Public key infrastructure
A central problem with the use of publickey cryptography is confidence that a particular public key is authentic, that means that it is correct and belongs to the right person and has not been tampered by a malicious third party. The usual approach to this problem is to use a publickey infrastructure, in which one or more third parties – known as certificate authorities – certify ownership of key pairs.
A public key infrastructure is a system for the creation, storage, and distribution of digital certificates which are used to verify that a particular public key belongs to a certain entity. The PKI creates digital certificates which map public keys to entities, securely stores these certificates in a central repository and revokes them if needed.
VIDEO: Introduction to PublicKey Cryptography
You will get an awesome place to trade your
Bitcoin and more. Click for further information!
Choose your topic
and start the journey

Lesson 1
The History of Money
The History of Money 
Lesson 2
Money's Concrete History
Money's concrete history 
Lesson 3
Inflation and Deflation
Inflation and deflation 
Lesson 4
The Banking System
The banking system 
Lesson 5
Austrian Economics
Austrian economics 
Lesson 6
Keynesian Economics
Keynesian economics 
Lesson 7
Marxian Economics
Marxian economics 
Lesson 8
Overview about Bitcoin
Overview about Bitcoin 
Lesson 9
Milestones of Bitcoin
Milestones of Bitcoin 
Lesson 10
Bitcoin as Currency
Bitcoin as Currency 
Lesson 11
Bitcoin Clients
Bitcoin Clients 
Lesson 12
Bitcoin Mining
Bitcoin Mining 
Lesson 13
Bitcoin Transactions
Bitcoin Transactions 
Lesson 14
The Blockchain
The Blockchain 
Lesson 15
Technical Background
Bitcoin technical background 
Lesson 16
Bitcoin Predictions
Bitcoin Predicitions 
Lesson 17
MultiSignature
MultiSignature 
Lesson 18
PublicKey Cryptography
PublicKey Cryptography 
Lesson 19
Mathematics of Bitcoin
Mathematics of Bitcoin 
Lesson 21
Proof of Work

Lesson 20
The 51% Attack
The 51% Attack and Double Spending