Technology Sharing

Detailed Explanation of Cryptography Principles【5】

2024-07-08

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

Shift Cipher

Overview

Taking z 26 operation as an example, k is the key encryption: ek ( x ) = ( xk ) mod 26 decryption: dk ( x ) = ( x − k ) mod 26 Taking z_{26} operation as an example, k is the key \ encryption: e_k(x)=(xk) mod 26 \ decryption: d_k(x)=(xk) mod 26byz26Operation as an example,kFor the keyencryption:ek(x)=(x k)mod26Decryption:dk(x)=(xk)mod26
In practice, we use Z 256 Z_{256} Z256Operation (addition of groups)

Code

#include