Encryption basics

General principles of modern encryption

view on github

Types of encryption

✔️ Symmetric encryption :

  • the same key is used for encryption and decryption
  • 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
  • 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 :

  • A key pair generation process involves very large prime numbers and modular arithmetic.
  • When very large prime numbers are multiplied together, their product is essentially impossible to factor without knowing what the original numbers were.
  • 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.