Voorbeeld OTP¶
Test het zelf eens uit via https://github.com/HoGentTIN/cybersec-otp .
Encryptie¶
plaintext | h | e | l | l | o |
plaintext | 7 | 4 | 11 | 11 | 14 |
key | w | a | c | h | t |
key | 22 | 0 | 2 | 7 | 19 |
plaintext + key | 29 | 4 | 13 | 18 | 33 |
(plaintext + key) mod 26 | 3 | 4 | 13 | 18 | 7 |
ciphertext | d | e | n | s | h |
Decryptie¶
ciphertext | d | e | n | s | h |
ciphertext | 3 | 4 | 13 | 18 | 7 |
key | w | a | c | h | t |
key | 22 | 0 | 2 | 7 | 19 |
ciphertext - key | -19 | 4 | 11 | 11 | -12 |
(ciphertext - key) mod 26 | 7 | 4 | 11 | 11 | 14 |
plaintext | h | e | l | l | o |