Symmetric Cryptography

Symmetric key algorithm. ​These types of encryption algorithms ​are called symmetric because ​they use the same key to encrypt and decrypt messages.

Substitution cipher: An encryption mechanism that replaces parts of your plaintext with ciphertext

Block ciphers: The cipher takes data in, places that into a bucket or block of data that’s a fixed size, then encodes that entire block as one unit

  • If the data to be encrypted ​isn’t big enough to fill the block, ​the extra space will be padded to ​ensure the plain text fits into the blocks evenly

Stream ciphers: It takes a stream of input and encrypts the stream one character or one digit at a time, outputting one encrypted character or digit at a time

  •  ​There’s a one-to-one relationship ​between data in an encrypted data out

 ​To avoid key reuse, ​initialization vector or IV is used. ​That’s a bit of random data that’s ​integrated into the encryption key, ​and the resulting combined key ​is then used to encrypt the data. ​  - The idea behind this is, ​if you have one shared master key, ​then generate a onetime encryption key. ​That encryption key is used only once by ​generating a new key using the master one and the IV.  - ​In order for the encrypted message to be decoded, ​the IV must be sent in ​plain text along with the encrypted message. Pasted image 20260702123335