Software engineering notes

Cryptography

Asymmetric cryptography (public-key cryptography)

It contains a pair of Public key and Private key.

Public key

Private key

In short, the data that is encrypted by public key can only be decrypted by private key. The signature that is encrypted by private key can be verified by public key.

Symmetric-key cryptography (secret-key or private-key cryptography)

The same key is used for encryption and decryption.

Comparison between Asymmetric and Symmetric encryption

Use cases

AES

AES replaced the older Data Encryption Standard (DES) as a more secure and efficient option.

Electronic Codebook mode (ECB)

Cipher Feedback (CFB)

Cipher Block Chaining mode (CBC)

Galois/Counter Mode (GCM)

What’s Initialization Vector (IV)?

What’s Counter (CTR)

CTR mode is that it turns a block cipher into a stream cipher, which means that it encrypts plaintext by combining it with a keystream.

ECB vs CFB vs CBC vs GCM (in terms of security)

Hash functions

ref: