# Category: Keys

• ## What is a cryptographically secure random number generator?

Random number generation is a very important topic in Cryptography. It is the technique that helps us avoid brute force attacks. A brute force attack is when the attacker tries all possible keys to try to decode an encrypted message. If the attacker can predict how the key was generated, then the number of keys […]

• ## Primality tests: The Miller-Rabin test

Prime numbers are very important in Cryptography. It is for that reason that you will have to study some methods for testing whether a given number is prime or not (a.k.a. primality tests). One of such methods is the Miller-Rabin Test. A number n is prime if and only if it has only two divisors, […]

• ## What is the Diffie-Hellman Key Exchange?

Diffie-Hellman (DH) Key Exchange is one of the earliest Public Key Cryptosystem. The protocol uses a public key to securely exchange the private key. Although it is a Public Key Cryptosystem, the main goal of this protocol is to exchange a key (a.k.a. shared secret), so the two users can then encrypt the information using […]

• ## How to generate Elliptic Curve Cryptography (ECC) key pairs

Elliptic Curve Cryptography (ECC) is a modern Public Key Cryptosystem. ECC is difficult to explain because of all the mathematics background you need to understand the algorithms. In this post, I’ll give you a practical approach and I’ll show you how you can generate key pairs using ECC and Python. Example of key pair generation […]

• ## How to generate RSA key pairs

The Rivest-Shamir-Adleman (RSA) scheme is the most widely accepted approach for public-key cryptography. Here I’ll show you how to generate RSA key pairs. The RSA algorithm to generate the key pairs is as follows: Choose p, q, two prime numbers Calculate n = pq Calculate f(n) = (p-1)(q-1) Chose e such that gcd(f(n), e) = […]

• ## How to create secure keys for symmetric encryption?

Secure keys creation is a topic of utmost importance in Cryptography and Network Security. The stronger the keys the better, the more secure your data will be. But, how to create strong keys/passwords? In classic cryptography, we were expected to create the keys used for encryption. For instance, Caesar Shift Cipher uses an integer number […]