Voorbeeld ROT13¶
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 | 13 | 13 | 13 | 13 | 13 |
| plaintext + key | 20 | 17 | 24 | 24 | 27 |
| (plaintext + key) mod 26 | 20 | 17 | 24 | 24 | 1 |
| ciphertext | u | r | y | y | b |
Decryptie¶
| ciphertext | u | r | y | y | b |
| ciphertext | 20 | 17 | 24 | 24 | 1 |
| key | 13 | 13 | 13 | 13 | 13 |
| ciphertext - key | 7 | 4 | 11 | 11 | -12 |
| (ciphertext - key) mod 26 | 7 | 4 | 11 | 11 | 14 |
| plaintext | h | e | l | l | o |