Encryption basics

General principles of modern encryption

view on github

Types of encryption

Symmetric encryption

  • The same key is used for encryption and decryption.
  • Adapted to fast processing of large quantity of data.
  • Small key length (128 - 256 bits).
  • Algorithms : 3DES, AES, DES, RC4.

Asymmetric encryption

  • A public key is used for encryption, a private key is used for decryption.
  • Adapted to slow processing of small quantity of data.
  • Large key length (1024 - 4096 bits).
  • Algorithms : Diffie-Hellman, ECC, ElGamal, DSA, RSA.

General encryption paradigm or how are key pairs generated

  • The creation of a key pair involves very large prime numbers and modular arithmetic.
  • When multiplying very large prime numbers together, their product is impossible to factor without knowledge of the original numbers.
  • It’s not magic, it just happens to be the way the maths work with prime numbers.
  • In order to crack the encryption, one would have to be able to factor the product of those large prime numbers, which current computing power does not allow.